mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-10-12 15:04:04 +00:00
Compare commits
510
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e818bc5e4d | ||
|
|
3e06740758 | ||
|
|
dc4939ee78 | ||
|
|
bca2884aa2 | ||
|
|
e2c2339f89 | ||
|
|
63d0bfc69b | ||
|
|
ab05f32fde | ||
|
|
68482a429e | ||
|
|
62e704a6cf | ||
|
|
2d5446bfc7 | ||
|
|
6f4482cff4 | ||
|
|
96a373682a | ||
|
|
cdd36f61b1 | ||
|
|
ebb0042881 | ||
|
|
4e7a3b22fe | ||
|
|
221d810f3f | ||
|
|
9e2cc68531 | ||
|
|
45647f0cec | ||
|
|
50a518ea7a | ||
|
|
2b44b421dc | ||
|
|
70a93cc093 | ||
|
|
0c4d102850 | ||
|
|
2e15f2c5ab | ||
|
|
4768fbda15 | ||
|
|
d8959d9776 | ||
|
|
9e2a818eab | ||
|
|
27bd463109 | ||
|
|
784e5693b4 | ||
|
|
88b49b70e9 | ||
|
|
3214ae3101 | ||
|
|
1f570f8495 | ||
|
|
67a33f2ceb | ||
|
|
4549c92d50 | ||
|
|
751445c199 | ||
|
|
916f5dd68e | ||
|
|
efc8fa1eeb | ||
|
|
5313693651 | ||
|
|
0239977d21 | ||
|
|
d58edff92d | ||
|
|
ca4043833e | ||
|
|
643929a0c6 | ||
|
|
a5aa4c8466 | ||
|
|
8db60c67f8 | ||
|
|
b97dec7343 | ||
|
|
8b58c82385 | ||
|
|
3034615455 | ||
|
|
9b137452d9 | ||
|
|
65c931ea2d | ||
|
|
5aa007f49c | ||
|
|
762fd1cadd | ||
|
|
9feb442a07 | ||
|
|
e24a66a454 | ||
|
|
af978e1312 | ||
|
|
a53c4fd623 | ||
|
|
59c5100a86 | ||
|
|
cf6e747def | ||
|
|
22500a96c1 | ||
|
|
03af6bfda5 | ||
|
|
0fafb95bd8 | ||
|
|
1d838f8116 | ||
|
|
9605227139 | ||
|
|
a64219dd25 | ||
|
|
e06d5fbdc1 | ||
|
|
d30595bbfb | ||
|
|
43d5068cda | ||
|
|
eebe2d6aec | ||
|
|
d5fa13d644 | ||
|
|
9ae2c91677 | ||
|
|
e369a8c03f | ||
|
|
98175c5976 | ||
|
|
94992f40bd | ||
|
|
1e2dbeac10 | ||
|
|
153717b187 | ||
|
|
dd15b37f0f | ||
|
|
2fc2d12d65 | ||
|
|
0279813ba9 | ||
|
|
1c4c90ffba | ||
|
|
c79f664f9e | ||
|
|
f817527ab9 | ||
|
|
754e619e30 | ||
|
|
fb0a92a636 | ||
|
|
03858b12b9 | ||
|
|
342dede1b0 | ||
|
|
6e1c0fe623 | ||
|
|
fece3f7477 | ||
|
|
ab2333f708 | ||
|
|
c4e79ffdf9 | ||
|
|
4d2a6589b4 | ||
|
|
191a81058c | ||
|
|
dd25c7af75 | ||
|
|
ef996273a7 | ||
|
|
eb164f5f69 | ||
|
|
adce19e651 | ||
|
|
e7127ae624 | ||
|
|
842ad77092 | ||
|
|
96104fd93a | ||
|
|
c34a74c040 | ||
|
|
ff33ea943d | ||
|
|
43b849e787 | ||
|
|
a4f8154662 | ||
|
|
33d3983a97 | ||
|
|
a9f84eda42 | ||
|
|
3f3e94bdc9 | ||
|
|
72e7b215ef | ||
|
|
9bd3e7b1bc | ||
|
|
45595ab1fd | ||
|
|
3f056babac | ||
|
|
faad2c4a9a | ||
|
|
1a81f4a541 | ||
|
|
326e8c651c | ||
|
|
dfaaabfc2a | ||
|
|
f07f37ec35 | ||
|
|
1357ed5d3d | ||
|
|
dafff1620d | ||
|
|
fc89a25d3a | ||
|
|
aaf8dd16ef | ||
|
|
fba5953b59 | ||
|
|
7ea80395a8 | ||
|
|
2d7458eefe | ||
|
|
9a45efd558 | ||
|
|
205b217854 | ||
|
|
e5ec9177e3 | ||
|
|
19c4cd70b8 | ||
|
|
75c341d983 | ||
|
|
f73f36ea6f | ||
|
|
6faf1cbcc2 | ||
|
|
87bd3975b8 | ||
|
|
5dc34ac0d0 | ||
|
|
09f18d9039 | ||
|
|
2ffaf36270 | ||
|
|
ec8b9a4c0a | ||
|
|
80e17e264a | ||
|
|
99445d2372 | ||
|
|
0ab6e3d00d | ||
|
|
385b262be8 | ||
|
|
b4206e1e48 | ||
|
|
e09555908a | ||
|
|
38060c60fb | ||
|
|
40516b34a2 | ||
|
|
ea97e3a192 | ||
|
|
f34481ae60 | ||
|
|
fcf3cbac6c | ||
|
|
40b28b88b9 | ||
|
|
11f2f0ad75 | ||
|
|
4ecf1845d4 | ||
|
|
60b2c89c66 | ||
|
|
07d04d5701 | ||
|
|
3c373aac25 | ||
|
|
4e2254dfc7 | ||
|
|
a765de11ef | ||
|
|
fe65dc60c4 | ||
|
|
e976c825c9 | ||
|
|
88b5a0af46 | ||
|
|
a53551b462 | ||
|
|
f15349029f | ||
|
|
989ce6d707 | ||
|
|
018169b06a | ||
|
|
7275d6e897 | ||
|
|
0416a2ce7d | ||
|
|
dde95c8e01 | ||
|
|
349a0641cd | ||
|
|
304870f18c | ||
|
|
71e3cdb78d | ||
|
|
7260a0a00e | ||
|
|
5cfa398ea6 | ||
|
|
05375955d6 | ||
|
|
a0ea54d0c0 | ||
|
|
de627171d5 | ||
|
|
6f3c0fb174 | ||
|
|
76130bbf2c | ||
|
|
90bce8d3d5 | ||
|
|
0ce4acc71b | ||
|
|
364b506220 | ||
|
|
33038f409a | ||
|
|
1b4297a9bf | ||
|
|
1bbea69139 | ||
|
|
f8cea9036c | ||
|
|
916dab2584 | ||
|
|
67d53126c3 | ||
|
|
d639ec5e70 | ||
|
|
c6b1d518cf | ||
|
|
708ffac47e | ||
|
|
aff83fae49 | ||
|
|
90d8f5f2cc | ||
|
|
4e3ddad8c1 | ||
|
|
c2cb3f5b7a | ||
|
|
778bed969d | ||
|
|
cff5fa6d7b | ||
|
|
c24b6e6b32 | ||
|
|
e7b4a512ca | ||
|
|
cabda4cc35 | ||
|
|
a5d4629f07 | ||
|
|
16166db31a | ||
|
|
37d9ef66ed | ||
|
|
b2213bff62 | ||
|
|
411d2192cb | ||
|
|
391bf296d7 | ||
|
|
ab854067eb | ||
|
|
9e9990dd6e | ||
|
|
b80805e09c | ||
|
|
d22ed099bb | ||
|
|
84c99d23cd | ||
|
|
36a302f20f | ||
|
|
9a592047a0 | ||
|
|
e6947a3246 | ||
|
|
5cd0897348 | ||
|
|
a973a50576 | ||
|
|
7121b46bf9 | ||
|
|
00f07ba6f0 | ||
|
|
4c1d3ceedf | ||
|
|
f674546df8 | ||
|
|
7910cf3055 | ||
|
|
ab1c8e63ee | ||
|
|
67bbe9c105 | ||
|
|
4d01b60808 | ||
|
|
b2af8587c2 | ||
|
|
409c0d7fb4 | ||
|
|
97be497fda | ||
|
|
e1e228eae2 | ||
|
|
1ece31fa7a | ||
|
|
b27d2a6b62 | ||
|
|
475b6210e0 | ||
|
|
42fc89a944 | ||
|
|
9a951c499b | ||
|
|
86b06db9ff | ||
|
|
4e67d7b765 | ||
|
|
e4c52701b7 | ||
|
|
3c9f46941c | ||
|
|
b59c962f60 | ||
|
|
0d5c898106 | ||
|
|
c9c92f82d3 | ||
|
|
d57985b90a | ||
|
|
56fcb23275 | ||
|
|
dba199b531 | ||
|
|
193dd166c3 | ||
|
|
0a46bf52dd | ||
|
|
431e0bb341 | ||
|
|
beb54c1bc5 | ||
|
|
1afc4c9a29 | ||
|
|
96b4210d21 | ||
|
|
85fcecdcf6 | ||
|
|
55dc2b26d2 | ||
|
|
9c7a85826b | ||
|
|
4e6a2d5218 | ||
|
|
273f00a9c4 | ||
|
|
e876b9e4ab | ||
|
|
32de4aac6b | ||
|
|
fc4b191dea | ||
|
|
cad23ef1ad | ||
|
|
0e10702fad | ||
|
|
0012e23bf6 | ||
|
|
2801b9baf2 | ||
|
|
5dd07525dc | ||
|
|
d7cb61e5fc | ||
|
|
38447e2217 | ||
|
|
759aad047b | ||
|
|
db7f46a874 | ||
|
|
fd0262f708 | ||
|
|
a06d7bbfec | ||
|
|
16689f4d6e | ||
|
|
d1adc160ca | ||
|
|
0bd75716f2 | ||
|
|
a70ef78ead | ||
|
|
9782fe5459 | ||
|
|
5e509f7f19 | ||
|
|
3f257af006 | ||
|
|
7fac6062e5 | ||
|
|
7ba74143df | ||
|
|
e110e8fa57 | ||
|
|
d018ab18f8 | ||
|
|
76b9c6781d | ||
|
|
856706bc1c | ||
|
|
0411befe8d | ||
|
|
8bf18b0d37 | ||
|
|
d54747c4df | ||
|
|
7e141f73d3 | ||
|
|
da3b329772 | ||
|
|
7f9dcc43ad | ||
|
|
274262262a | ||
|
|
79c0f31ddc | ||
|
|
49d61342c2 | ||
|
|
be0943f1ba | ||
|
|
41d40102f3 | ||
|
|
95e63f865c | ||
|
|
1496045c40 | ||
|
|
e2dadcd208 | ||
|
|
164c11e10a | ||
|
|
070ac1e878 | ||
|
|
765884b0dc | ||
|
|
fe8cf9bc83 | ||
|
|
f45782aeef | ||
|
|
c2faff5a03 | ||
|
|
1cff18112b | ||
|
|
195b99e588 | ||
|
|
63ff8dd4c4 | ||
|
|
6019489ef1 | ||
|
|
fc79f92796 | ||
|
|
8e569a9ccd | ||
|
|
d7b2964e4e | ||
|
|
366edb7e90 | ||
|
|
9430135592 | ||
|
|
199b62d13f | ||
|
|
b0fc5a3618 | ||
|
|
b0f90cafb6 | ||
|
|
6e599908cd | ||
|
|
b1be5a4ba4 | ||
|
|
71f68da90b | ||
|
|
c11fd03362 | ||
|
|
ec1422a136 | ||
|
|
d56d1bc2bd | ||
|
|
45eca862ac | ||
|
|
89e98056e6 | ||
|
|
9f738f4871 | ||
|
|
3533a3fd4b | ||
|
|
5cf14aa886 | ||
|
|
9ee6a0a01a | ||
|
|
6d26ec2ab7 | ||
|
|
672acfe8fe | ||
|
|
6a4db90897 | ||
|
|
82587a70be | ||
|
|
0a18fcf732 | ||
|
|
d0ef9ca96c | ||
|
|
a5d5d42ba3 | ||
|
|
e08b731cb5 | ||
|
|
15441a46f7 | ||
|
|
a9a56bb1e9 | ||
|
|
e840be84eb | ||
|
|
0b40455e3c | ||
|
|
d9ea5a95af | ||
|
|
d1a4cfd5df | ||
|
|
23502d4fab | ||
|
|
37b70861d1 | ||
|
|
150d54eeda | ||
|
|
3690babf62 | ||
|
|
68b26a1091 | ||
|
|
9ca7ff73f4 | ||
|
|
c56064d189 | ||
|
|
5c371a20d2 | ||
|
|
424495c636 | ||
|
|
9c7e98f1cb | ||
|
|
d42157c5f8 | ||
|
|
502851856b | ||
|
|
23edcf3aa7 | ||
|
|
ca19306b72 | ||
|
|
66c0c14748 | ||
|
|
cffa493984 | ||
|
|
9030cdcc76 | ||
|
|
c3ef487a6f | ||
|
|
ac0eddf4c7 | ||
|
|
e373e797f4 | ||
|
|
382244035b | ||
|
|
b9c8c71274 | ||
|
|
e86e7f0bd8 | ||
|
|
c36f259571 | ||
|
|
501bae585a | ||
|
|
2c72f704d0 | ||
|
|
194de7b4e7 | ||
|
|
c03609142b | ||
|
|
5374f71732 | ||
|
|
c53d451000 | ||
|
|
f6747713a1 | ||
|
|
59ddf175ed | ||
|
|
ccd8d5f871 | ||
|
|
bd47ad2b8c | ||
|
|
e90019cdd8 | ||
|
|
be508c99ea | ||
|
|
71a77fc576 | ||
|
|
a028297da6 | ||
|
|
ac44b36b59 | ||
|
|
4b767d4a57 | ||
|
|
5d461a72f6 | ||
|
|
5a6d20f817 | ||
|
|
942b4512fe | ||
|
|
3778b27574 | ||
|
|
15b340db56 | ||
|
|
ce5da22180 | ||
|
|
05b2c3c42b | ||
|
|
2dd732b924 | ||
|
|
110f73e622 | ||
|
|
bb0d118284 | ||
|
|
701ccadff3 | ||
|
|
34555504df | ||
|
|
d1f5220925 | ||
|
|
decd514b22 | ||
|
|
6cf7093293 | ||
|
|
17f11fa871 | ||
|
|
96812868a4 | ||
|
|
40c79158f7 | ||
|
|
054663ee00 | ||
|
|
81eee814e9 | ||
|
|
390a3c0d5a | ||
|
|
695dd655c0 | ||
|
|
05838cc477 | ||
|
|
c34ffedb42 | ||
|
|
96e02c9911 | ||
|
|
248fceb4b5 | ||
|
|
b5382b1bdf | ||
|
|
519cbc7601 | ||
|
|
92697d9468 | ||
|
|
d1ec9c92eb | ||
|
|
957da460a6 | ||
|
|
8f9f447acf | ||
|
|
2cee36d7b5 | ||
|
|
454cf5ea64 | ||
|
|
4563533e67 | ||
|
|
640e719eda | ||
|
|
aece2b1d90 | ||
|
|
43925e3088 | ||
|
|
1c236cce02 | ||
|
|
4956a517ca | ||
|
|
cb13655ecd | ||
|
|
9b3b6cec8f | ||
|
|
3ca1a1f1c7 | ||
|
|
a7210208d6 | ||
|
|
eaad23ff69 | ||
|
|
c7ddf0a2a9 | ||
|
|
b129ef873b | ||
|
|
d927426d70 | ||
|
|
d9c7df736c | ||
|
|
9ced137ded | ||
|
|
73244df019 | ||
|
|
91d24ebae8 | ||
|
|
6861e26ed6 | ||
|
|
a89da50e0a | ||
|
|
9256046b6c | ||
|
|
fd95dd8023 | ||
|
|
cda2b84939 | ||
|
|
34242e12ea | ||
|
|
d893fe63e7 | ||
|
|
5aedf85982 | ||
|
|
55ab79c004 | ||
|
|
7c7a72600d | ||
|
|
bd67e41aa6 | ||
|
|
01357654c0 | ||
|
|
cd5900481b | ||
|
|
601c6c53e7 | ||
|
|
b7ba740a3a | ||
|
|
ddef97d49f | ||
|
|
47b0449f22 | ||
|
|
0193460678 | ||
|
|
e02b3e78d2 | ||
|
|
a6167583a3 | ||
|
|
c91e0a6b74 | ||
|
|
c6852a9514 | ||
|
|
04b5240615 | ||
|
|
483547cd9c | ||
|
|
345413cd1f | ||
|
|
046a60b89c | ||
|
|
da725e3ab1 | ||
|
|
edd34941cc | ||
|
|
c65686ef42 | ||
|
|
c7729f85df | ||
|
|
53b187c9b6 | ||
|
|
7bc18e41b1 | ||
|
|
8bc17eded5 | ||
|
|
9adeb1c63a | ||
|
|
091ed0dacd | ||
|
|
1e68eb0b90 | ||
|
|
332efd4106 | ||
|
|
cf0a47cab7 | ||
|
|
bb7b24346a | ||
|
|
f303191c54 | ||
|
|
a68e2e798b | ||
|
|
bd49f3c420 | ||
|
|
3c1d67267d | ||
|
|
d6c7f16ceb | ||
|
|
61e1933a5b | ||
|
|
f1912fe739 | ||
|
|
25c443098c | ||
|
|
2f7fe05d21 | ||
|
|
ee4b61f549 | ||
|
|
352c6e1d68 | ||
|
|
0e2444d7ce | ||
|
|
c4390819a2 | ||
|
|
51104268d8 | ||
|
|
cb5d43ab21 | ||
|
|
08de5cd377 | ||
|
|
274fa63658 | ||
|
|
81b2ed6551 | ||
|
|
d9c6c3947b | ||
|
|
2d6dbbdb16 | ||
|
|
b60faa1cab | ||
|
|
fd19953864 | ||
|
|
927bafd93a | ||
|
|
d93b21f0af | ||
|
|
511a4256bc | ||
|
|
3c9db86df2 | ||
|
|
367204a1ee | ||
|
|
6a8f6fa05a | ||
|
|
7f997c9411 | ||
|
|
2e3f98deb0 | ||
|
|
a5feb656e0 | ||
|
|
9329955328 | ||
|
|
5b99dd2685 | ||
|
|
19288fc8f5 | ||
|
|
9f97de5952 | ||
|
|
c476f7339c | ||
|
|
3dc1cf520a | ||
|
|
616c335a3b | ||
|
|
bbe55a75ea | ||
|
|
e58bf3a8cf | ||
|
|
1f2f866c61 | ||
|
|
6ccbc95697 | ||
|
|
52d9e0a195 | ||
|
|
6a3982347b | ||
|
|
fe7feeb74e | ||
|
|
b2419beca6 | ||
|
|
b752b475d9 | ||
|
|
658fe79ad7 | ||
|
|
5bbf05ac8a |
@@ -23,6 +23,15 @@ Events::on('loadRenderers', function ($renderers) {
|
||||
);
|
||||
});
|
||||
|
||||
Events::on('loadRenderers', function ($renderers) {
|
||||
$fhc_core_renderers =& $renderers();
|
||||
$fhc_core_renderers["slot_room"] = array(
|
||||
'modalTitle' => APP_ROOT.'public/js/components/Cis/Renderer/Slot/roomModalTitle.js',
|
||||
'modalContent' => APP_ROOT.'public/js/components/Cis/Renderer/Slot/roomModalContent.js',
|
||||
'calendarEventStyles' => APP_ROOT.'public/css/Cis4/CoreCalendarEvents.css'
|
||||
);
|
||||
});
|
||||
|
||||
Events::on('loadRenderers', function ($renderers) {
|
||||
$fhc_core_renderers =& $renderers();
|
||||
$fhc_core_renderers["ferien"] = array(
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
<?php
|
||||
|
||||
if (!defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
// Noten die keinen Prüfungsantritt verbrauchen. Fallback-PKs; massgeblich sind die per Bezeichnung
|
||||
// aufgelösten Noten (NOTEN_OHNE_ANTRITT_BEZEICHNUNGEN), da die PKs je Installation abweichen.
|
||||
$config['NOTEN_OHNE_ANTRITT'] = [9, 17]; // tbl_note pk
|
||||
|
||||
// 'Nicht beurteilt' ist eine Altlast: formal eine Note, inhaltlich keine Leistungsfeststellung.
|
||||
// Wird weiterhin häufig vergeben und darf daher keinen Antritt kosten.
|
||||
$config['NOTEN_OHNE_ANTRITT_BEZEICHNUNGEN'] = ['Noch nicht eingetragen', 'entschuldigt', 'Nicht beurteilt'];
|
||||
|
||||
// Anrechnungsnoten: die Leistung wurde vorab anerkannt, der/die Studierende ist zwar Teil der
|
||||
// Lehrveranstaltung, tritt aber zu keiner Prüfung an. Solange die ZEUGNISNOTE eine davon ist, sind
|
||||
// für diese Lehrveranstaltung keine Prüfungen möglich. Auflösung wie oben über die Bezeichnung,
|
||||
// die PKs sind nur Fallback.
|
||||
$config['NOTEN_ANRECHNUNG_BEZEICHNUNGEN'] = ['angerechnet', 'intern angerechnet'];
|
||||
$config['NOTEN_ANRECHNUNG'] = [6, 16]; // tbl_note pk
|
||||
|
||||
$config['NOTEN_OCCURANCE_LIMIT_MAP'] = [17 => 1]; // über alle Antritte hinweg nur ein entschuldigt
|
||||
|
||||
// tbl_note pk of the 'entschuldigt' note. An entschuldigt Termin is preserved as its own dated
|
||||
// entry when a new pruefung of the same type is created (instead of being overwritten).
|
||||
$config['NOTE_ENTSCHULDIGT'] = 17;
|
||||
|
||||
// The maximum number of attempts that count, the first attempt and the kommissionelle attempt
|
||||
// included. null derives the number from the old flags:
|
||||
// 1 (the original assessment) + TERMIN2 + TERMIN3 + KOMMPRUEF
|
||||
// The examination rules permit three attempts. With TERMIN2 and KOMMPRUEF the formula gives 3.
|
||||
// An installation with TERMIN3 gets 4, which is one more attempt in the same chain.
|
||||
$config['CIS_GESAMTNOTE_MAX_ANTRITTE'] = null;
|
||||
|
||||
// The exam types that take place before a commission.
|
||||
$config['PRUEFUNG_KOMMISSIONELL_TYPEN'] = ['kommPruef', 'zusKommPruef'];
|
||||
|
||||
// The type that the tool writes for the last attempt. The last attempt is always kommissionell.
|
||||
$config['PRUEFUNG_TYP_KOMMISSIONELL'] = 'kommPruef';
|
||||
|
||||
// Exam types that never use an attempt. A zusKommPruef repeats a kommissionelle Prüfung that had
|
||||
// a procedural fault. It stands outside the attempt chain, and the student administration enters
|
||||
// it. The examination rules do not describe it.
|
||||
$config['PRUEFUNG_TYPEN_OHNE_ANTRITT'] = ['zusKommPruef'];
|
||||
|
||||
// Spaltenaufteilung der Prüfungen in der Notentabelle:
|
||||
// 'antritt' - eine Spalte je Antrittsnummer, Datum steht in der Zelle (robust bei Einzelterminen)
|
||||
// 'datum' - eine Spalte je Prüfungsdatum (kompakt, wenn ganze Jahrgänge am selben Tag antreten)
|
||||
// Nur die Vorgabe; im Tool umschaltbar und pro Benutzer gespeichert.
|
||||
$config['CIS_GESAMTNOTE_PRUEFUNGSSPALTEN'] = 'antritt';
|
||||
|
||||
// Bei der Notenübernahme durch die Assistenz den ersten Antritt als eigene Prüfung anlegen.
|
||||
$config['CIS_GESAMTNOTE_ERSTANTRITT_BEI_UEBERNAHME'] = true;
|
||||
|
||||
// availability of the two Benotungstool import flows. When both are true they are shown as
|
||||
// separate buttons/dialogs.
|
||||
$config['CIS_GESAMTNOTE_PRUEFUNGSIMPORT'] = true; // dated import that creates a pruefung per row
|
||||
$config['CIS_GESAMTNOTE_NOTENIMPORT'] = false; // classic note-only import (uid + note, no date)
|
||||
|
||||
// Noteneintragungsfrist (Prüfungsordnung §1): grade/pruefung entry is only permitted up to this
|
||||
// deadline. The month/day below is applied to the studiensemester's year:
|
||||
// Sommersemester (SSyyyy) -> deadline in the SAME calendar year (default 15th November)
|
||||
// Wintersemester (WSyyyy) -> deadline in the FOLLOWING calendar year (default 15th May)
|
||||
$config['CIS_GESAMTNOTE_NOTENEINTRAGUNGSFRIST'] = false; // switch to use the window enforcement
|
||||
$config['NOTENEINTRAGUNGSFRIST_SS'] = ['month' => 11, 'day' => 15]; // Sommersemester deadline (same year)
|
||||
$config['NOTENEINTRAGUNGSFRIST_WS'] = ['month' => 5, 'day' => 15]; // Wintersemester deadline (following year)
|
||||
@@ -61,12 +61,29 @@ $route['api/v1/organisation/[O|o]rganisationseinheit/(:any)'] = 'api/v1/organisa
|
||||
$route['api/v1/ressource/[B|b]etriebsmittelperson/(:any)'] = 'api/v1/ressource/betriebsmittelperson2/$1';
|
||||
$route['api/v1/system/[S|s]prache/(:any)'] = 'api/v1/system/sprache2/$1';
|
||||
|
||||
// Legacy CMS news routes
|
||||
$route['api/frontend/v1/Cms/getNewsItem/(:num)'] = 'api/frontend/v1/NewsAdministrationAPI/getNewsItem/$1';
|
||||
$route['api/frontend/v1/Cms/storeNewsItem'] = 'api/frontend/v1/NewsAdministrationAPI/storeNewsItem';
|
||||
$route['api/frontend/v1/Cms/updateNewsItem/(:num)'] = 'api/frontend/v1/NewsAdministrationAPI/updateNewsItem/$1';
|
||||
$route['api/frontend/v1/Cms/deleteNewsItem/(:num)'] = 'api/frontend/v1/NewsAdministrationAPI/deleteNewsItem/$1';
|
||||
|
||||
// Keep legacy uppercase URLs refreshable while using the canonical controller method casing
|
||||
$route['CisVue/Cms/NewsAdministration'] = 'CisVue/Cms/newsAdministration';
|
||||
|
||||
$route['Cis/LvPlan/.*'] = 'Cis/LvPlan/index/$1';
|
||||
$route['Cis/MyLvPlan/.*'] = 'Cis/MyLvPlan/index/$1';
|
||||
$route['Cis/MyLv/.*'] = 'Cis/MyLv/index/$1';
|
||||
$route['Cis/OtherLvPlan/.*'] = 'Cis/OtherLvPlan/index/$1';
|
||||
//Route for LV Plan Stg/Semester/Verband/Gruppe
|
||||
$route['Cis/StgOrgLvPlan/.*'] = 'Cis/StgOrgLvPlan/index/$1';
|
||||
$route['Cis/Benotungstool/.*'] = 'Cis/Benotungstool/index/$1';
|
||||
|
||||
$route['Cis/MyReservation'] = 'Cis/MyReservation/index/$1';
|
||||
|
||||
//Route for Zeitsperrenma
|
||||
$route['Cis/Zeitsperrenma/.*'] = 'Cis/Zeitsperrenma/index/$1';
|
||||
//Route für Zeitsperren
|
||||
$route['Cis/Zeitsperren/.*'] = 'Cis/Zeitsperren/index/$1';
|
||||
|
||||
$route['Abgabetool/Assistenz'] = 'Cis/Abgabetool/Assistenz';
|
||||
$route['Abgabetool/Assistenz/(:any)'] = 'Cis/Abgabetool/Assistenz/$1';
|
||||
@@ -129,13 +146,19 @@ $route['api/frontend/v1/treemenudata/stv/.*'] = 'api/frontend/v1/stv/students/in
|
||||
$route['api/frontend/v1/treemenudata/lvverwaltung/stdsem/(:any)/stg/(:any)'] = 'api/frontend/v1/Lehrveranstaltung/getByStg/$1/$2';
|
||||
$route['api/frontend/v1/treemenudata/lvverwaltung/stdsem/(:any)/stg/(:any)/semester/(:any)'] = 'api/frontend/v1/Lehrveranstaltung/getByStg/$1/$2/$3';
|
||||
$route['api/frontend/v1/treemenudata/lvverwaltung/stdsem/(:any)/stg/(:any)/semester/(:any)/.*'] = 'api/frontend/v1/Lehrveranstaltung/getByStg/$1/$2/$3';
|
||||
$route['api/frontend/v1/treemenudata/lvverwaltung/stdsem/(:any)/stg/(:any)/orgform/(:any)'] = 'api/frontend/v1/Lehrveranstaltung/getByStg/$1/$2/$3';
|
||||
$route['api/frontend/v1/treemenudata/lvverwaltung/stdsem/(:any)/stg/(:any)/orgform/(:any)/.*'] = 'api/frontend/v1/Lehrveranstaltung/getByStg/$1/$2/$3';
|
||||
|
||||
$route['api/frontend/v1/treemenudata/lvverwaltung/stdsem/(:any)/stg/(:any)/orgform/(:any)/semester/(:any)'] = 'api/frontend/v1/Lehrveranstaltung/getByStgOrgform/$1/$2/$3/$4';
|
||||
$route['api/frontend/v1/treemenudata/lvverwaltung/stdsem/(:any)/stg/(:any)/orgform/(:any)/semester/(:any)/.*'] = 'api/frontend/v1/Lehrveranstaltung/getByStgOrgform/$1/$2/$3/$4';
|
||||
$route['api/frontend/v1/treemenudata/lvverwaltung/stdsem/(:any)/stg/(:any)/orgform/(:any)'] = 'api/frontend/v1/Lehrveranstaltung/getByStgOrgform/$1/$2/$3';
|
||||
$route['api/frontend/v1/treemenudata/lvverwaltung/stdsem/(:any)/stg/(:any)/orgform/(:any)/.*'] = 'api/frontend/v1/Lehrveranstaltung/getByStgOrgform/$1/$2/$3';
|
||||
|
||||
$route['api/frontend/v1/treemenudata/lvverwaltung/stdsem/(:any)/emp/(:any)'] = 'api/frontend/v1/Lehrveranstaltung/getByEmp/$1/$2';
|
||||
$route['api/frontend/v1/treemenudata/lvverwaltung/stdsem/(:any)/emp/(:any)/stg/(:any)'] = 'api/frontend/v1/Lehrveranstaltung/getByEmp/$1/$2/$3';
|
||||
$route['api/frontend/v1/treemenudata/lvverwaltung/stdsem/(:any)/emp/(:any)/stg/(:any)/.*'] = 'api/frontend/v1/Lehrveranstaltung/getByEmp/$1/$2/$3';
|
||||
|
||||
$route['api/frontend/v1/treemenudata/lvverwaltung/stdsem/(:any)/le/(:any)'] = 'api/frontend/v1/Lehrveranstaltung/getByLe/$1/$2';
|
||||
$route['api/frontend/v1/treemenudata/lvverwaltung/stdsem/(:any)/lv/(:any)'] = 'api/frontend/v1/Lehrveranstaltung/getByLv/$1/$2';
|
||||
|
||||
|
||||
// load routes from extensions, also look for environment-specific configs
|
||||
$subdirs = ['application/config/extensions', 'application/config/' . ENVIRONMENT . '/extensions'];
|
||||
|
||||
@@ -26,7 +26,8 @@ $config['root'] = [
|
||||
'verband' => [
|
||||
'group'
|
||||
]
|
||||
],
|
||||
'orgform'
|
||||
]
|
||||
]
|
||||
];
|
||||
|
||||
$config['root']['stg']['orgform'] = $config['root']['stg'];
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class Benotungstool extends Auth_Controller
|
||||
{
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'index' => array('lehre/benotungstool:rw', 'lehre/benotungstool_assistenz:rw')
|
||||
]);
|
||||
|
||||
$this->_ci =& get_instance();
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$viewData = array(
|
||||
'uid'=>getAuthUID(),
|
||||
);
|
||||
|
||||
$this->load->view('CisRouterView/CisRouterView.php', ['viewData' => $viewData, 'route' => 'Benotungstool']);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -20,12 +20,8 @@ class Documents extends Auth_Controller
|
||||
'download' => [self::PERM_LOGGED]
|
||||
]);
|
||||
|
||||
// Load models
|
||||
$this->load->model('crm/Prestudentstatus_model', 'PrestudentstatusModel');
|
||||
|
||||
// Load libraries
|
||||
$this->load->library('AkteLib');
|
||||
|
||||
$this->loadPhrases([
|
||||
'global',
|
||||
'tools'
|
||||
@@ -116,12 +112,10 @@ class Documents extends Auth_Controller
|
||||
|
||||
$selfservice = null;
|
||||
if (!defined('CIS_DOKUMENTE_SELFSERVICE') || CIS_DOKUMENTE_SELFSERVICE) {
|
||||
$this->load->model('crm/Akte_model', 'AkteModel');
|
||||
$selfservice = [];
|
||||
foreach ($person_ids as $person_id) {
|
||||
$result = $this->aktelib->getByPersonId(
|
||||
$person_id,
|
||||
true
|
||||
);
|
||||
$result = $this->AkteModel->getArchiv($person_id, null, true);
|
||||
if (isError($result))
|
||||
return $this->load->view('errors/html/error_db.php', [
|
||||
'heading' => 'Database Error',
|
||||
@@ -153,13 +147,14 @@ class Documents extends Auth_Controller
|
||||
if (!is_numeric($akte_id))
|
||||
return show_404();
|
||||
|
||||
$result = $this->aktelib->getByAkteId($akte_id);
|
||||
$this->load->model('crm/Akte_model', 'AkteModel');
|
||||
$result = $this->AkteModel->load($akte_id);
|
||||
if (isError($result))
|
||||
return show_error(getError($result));
|
||||
$akte = getData($result);
|
||||
if (!$akte)
|
||||
return show_404();
|
||||
$akte = reset($akte);
|
||||
$akte = current($akte);
|
||||
|
||||
$admin_access = false;
|
||||
if ($uid !== null && $this->permissionlib->isBerechtigt('admin')) {
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class MyReservation extends Auth_Controller
|
||||
{
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'index' => ['basis/cis:r']
|
||||
]);
|
||||
|
||||
// Load Config
|
||||
$this->load->config('calendar');
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$this->load->view('CisRouterView/CisRouterView.php', ['route' => 'MyReservation']);
|
||||
}
|
||||
}
|
||||
@@ -64,7 +64,7 @@ class ProfilUpdate extends Auth_Controller
|
||||
{
|
||||
// Get file to be downloaded from DMS
|
||||
$newFilename = $this->uid . "/document_" . $dms_id;
|
||||
$download = $this->dmslib->getOutputFileInfo($dms_id);
|
||||
$download = $this->dmslib->download($dms_id);
|
||||
if (isError($download))
|
||||
return $download;
|
||||
|
||||
@@ -84,4 +84,3 @@ class ProfilUpdate extends Auth_Controller
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class ProjektabgabeUebersicht extends Auth_Controller
|
||||
{
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'index' => ['basis/cis:r']
|
||||
]);
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$this->load->view('CisRouterView/CisRouterView.php', ['route' => 'ProjektabgabeUebersicht']);
|
||||
}
|
||||
}
|
||||
@@ -29,15 +29,11 @@ class Pub extends Auth_Controller
|
||||
*/
|
||||
public function bild($source, $id)
|
||||
{
|
||||
$person_id_user = getAuthPersonId();
|
||||
$serverzugriff = false;
|
||||
// Default Bild (Dummy Profilbild)
|
||||
$outputFileName = FHCPATH . 'skin/images/profilbild_dummy.jpg';
|
||||
$outputFileContent = '';
|
||||
$mimetype = 'application/jpeg';
|
||||
|
||||
$this->load->model('person/Person_model', 'PersonModel');
|
||||
|
||||
$person_id_user = '';
|
||||
$serverzugriff = false;
|
||||
|
||||
// Wenn das Bild direkt aufgerufen wird, ist eine Authentifizierung erforderlich
|
||||
// Wenn es vom Server selbst aufgerufen wird, ist keine Auth. notwendig
|
||||
// (z.B. fuer die Erstellung von PDFs)
|
||||
@@ -49,27 +45,31 @@ class Pub extends Auth_Controller
|
||||
'zugangscode' => $_SESSION['incoming/user']
|
||||
]);
|
||||
if (hasData($result))
|
||||
$person_id_user = getData($result)[0]->person_id;
|
||||
$person_id_user = current(getData($result))->person_id;
|
||||
} elseif (isset($_SESSION['prestudent/user'])) { // Von Prestudententool
|
||||
$result = $this->PersonModel->loadWhere([
|
||||
'zugangscode' => $_SESSION['prestudent/user']
|
||||
]);
|
||||
if (hasData($result))
|
||||
$person_id_user = getData($result)[0]->person_id;
|
||||
$person_id_user = current(getData($result))->person_id;
|
||||
} elseif (isset($_SESSION['bewerbung/personId'])) { // Von Bewerbungstool
|
||||
$person_id_user = $_SESSION['bewerbung/personId'];
|
||||
} else {
|
||||
$person_id_user = getAuthPersonId();
|
||||
}
|
||||
} else {
|
||||
$serverzugriff = true;
|
||||
}
|
||||
|
||||
// If the picture is from the person table
|
||||
if ($source == 'person' && is_numeric($id)) {
|
||||
// Default Bild (Dummy Profilbild)
|
||||
$cTmpHEX = base64_encode(file_get_contents(FHCPATH . 'skin/images/profilbild_dummy.jpg'));
|
||||
|
||||
if ($source == 'person' && $id) {
|
||||
$foto_gesperrt = false;
|
||||
// Person laden und Fotosperre überprüfen
|
||||
$result = $this->PersonModel->load($id);
|
||||
if (hasData($result)) {
|
||||
$person = getData($result)[0];
|
||||
$person = current(getData($result));
|
||||
if ($person->foto_sperre) {
|
||||
// Wenn der User selbst darauf zugreift darf er das Bild sehen
|
||||
$foto_gesperrt = ($person_id_user != $id);
|
||||
@@ -77,57 +77,91 @@ class Pub extends Auth_Controller
|
||||
$foto_gesperrt = true;
|
||||
}
|
||||
|
||||
if (!isEmptyString($person->foto) && !$foto_gesperrt) {
|
||||
$outputFileContent = base64_decode($person->foto);
|
||||
if ($person->foto && !$foto_gesperrt) {
|
||||
$cTmpHEX = base64_decode($person->foto);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// If the picture is from the akte/dms
|
||||
if($source == 'akte' && is_numeric($id))
|
||||
if($source == 'akte' && $id != '')
|
||||
{
|
||||
$mimetype = '';
|
||||
$this->load->library('AkteLib');
|
||||
$this->load->model('crm/Akte_model', 'AkteModel');
|
||||
|
||||
$akteResult = $this->aktelib->getByAkteId($id, 'Lichtbil');
|
||||
$this->AkteModel->addJoin('public.tbl_person', 'person_id');
|
||||
$result = $this->AkteModel->loadWhere([
|
||||
'person_id' => $id,
|
||||
'dokument_kurzbz' => 'Lichtbil'
|
||||
]);
|
||||
|
||||
if (hasData($akteResult)) {
|
||||
if (hasData($result)) {
|
||||
$foto_gesperrt = false;
|
||||
$akte = getData($akteResult)[0];
|
||||
|
||||
$personResult = $this->PersonModel->load($akte->person_id);
|
||||
if (hasData($personResult)) {
|
||||
$person = getData($personResult)[0];
|
||||
if ($person->foto_sperre) {
|
||||
$foto_gesperrt = ($person_id_user != $id);
|
||||
} elseif (!$person_id_user && !$serverzugriff) {
|
||||
$foto_gesperrt = true;
|
||||
}
|
||||
$akte = current(getData($result));
|
||||
if ($akte->foto_sperre) {
|
||||
// Wenn der User selbst darauf zugreift darf er das Bild sehen
|
||||
$foto_gesperrt = ($person_id_user != $id);
|
||||
} elseif (!$person_id_user && !$serverzugriff) {
|
||||
$foto_gesperrt = true;
|
||||
}
|
||||
|
||||
// Wenn das Foto nicht im Inhalt steht wird aus aus dem DMS geladen
|
||||
if (!isEmptyString($akte->inhalt)) {
|
||||
$outputFileContent = base64_decode($akte->inhalt);
|
||||
$mimetype = $akte->mimetype;
|
||||
if (!$akte->inhalt && $akte->dms_id) {
|
||||
$this->load->model('content/Dms_model', 'DmsModel');
|
||||
$this->load->model('content/DmsVersion_model', 'DmsVersionModel');
|
||||
|
||||
$this->DmsModel->addJoin('campus.tbl_dms_version', 'dms_id');
|
||||
$this->DmsModel->addOrder('version', 'DESC');
|
||||
$this->DmsModel->addLimit(1);
|
||||
$result = $this->DmsModel->load($akte->dms_id);
|
||||
|
||||
if (!hasData($result))
|
||||
die('Kein Dokument vorhanden');
|
||||
|
||||
$dms = current(getData($result));
|
||||
|
||||
$filename = DMS_PATH . $dms->filename;
|
||||
|
||||
$this->DmsVersionModel->update([
|
||||
'dms_id' => $dms->dms_id,
|
||||
'version' => $dms->version
|
||||
], [
|
||||
'letzterzugriff' => date('c')
|
||||
]);
|
||||
|
||||
if (file_exists($filename)) {
|
||||
$handle = fopen($filename, "r");
|
||||
if ($handle) {
|
||||
while (!feof($handle)) {
|
||||
$akte->inhalt .= fread($handle, 8192);
|
||||
}
|
||||
fclose($handle);
|
||||
} else {
|
||||
echo 'Fehler: Datei konnte nicht geoeffnet werden';
|
||||
}
|
||||
} else {
|
||||
echo 'Die Datei existiert nicht';
|
||||
}
|
||||
}
|
||||
|
||||
if ($akte->inhalt && !$foto_gesperrt) {
|
||||
$cTmpHEX = $akte->inhalt;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// If file content is provided
|
||||
if (!isEmptyString($outputFileContent))
|
||||
{
|
||||
// If a mimetype is still not found
|
||||
if (isEmptyString($mimetype))
|
||||
{
|
||||
$fo = finfo_open();
|
||||
$mimetype = finfo_buffer($fo, $outputFileContent, FILEINFO_MIME_TYPE);
|
||||
}
|
||||
$this->outputImageByContent($mimetype, $outputFileContent);
|
||||
}
|
||||
else // otherwise use the file
|
||||
{
|
||||
$this->outputImageByFile($mimetype, $outputFileName);
|
||||
// die bilder werden, sofern es funktioniert, in jpg umgewandelt da es sonst zu fehlern beim erstellen
|
||||
// von pdfs kommen kann.
|
||||
|
||||
$im = @imagecreatefromstring(base64_decode($cTmpHEX));
|
||||
if ($im) {
|
||||
@ob_clean();
|
||||
header("Content-type: image/jpeg");
|
||||
exit(imagejpeg($im));
|
||||
} else {
|
||||
// bei manchen Bildern funktioniert die konvertierung nicht
|
||||
// diese werden dann einfach so angezeigt.
|
||||
@ob_clean();
|
||||
header("Content-type: image/gif");
|
||||
exit($cTmpHEX);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class Zeitsperren extends Auth_Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'index' => ['cis/eigene_zeitsperren:r'],
|
||||
]);
|
||||
|
||||
// Load Libraries
|
||||
$this->load->library('VariableLib', ['uid' => getAuthUID()]);
|
||||
}
|
||||
|
||||
/**
|
||||
* index loads the view Zeitsperren
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$viewData = array(
|
||||
'uid'=>getAuthUID(),
|
||||
);
|
||||
|
||||
$this->load->view('CisRouterView/CisRouterView.php', ['viewData' => $viewData, 'route' => 'zeitsperren']);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class Zeitsperrenma extends Auth_Controller
|
||||
{
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'index' => ['cis/andere_zeitsperren:r']
|
||||
]);
|
||||
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$this->load->view('CisRouterView/CisRouterView.php', ['route' => 'Zeitsperrenma']);
|
||||
}
|
||||
}
|
||||
@@ -17,14 +17,15 @@ class Cms extends Auth_Controller
|
||||
array(
|
||||
'content' => 'basis/cis:r',
|
||||
'getNews' => 'basis/cis:r',
|
||||
'getNewsRowCount' => 'basis/cis:r',
|
||||
'getRoomInformation' => 'basis/cis:r',
|
||||
'news' => 'basis/cis:r'
|
||||
'news' => 'basis/cis:r',
|
||||
'newsAdministration' => ['basis/news:r'],
|
||||
)
|
||||
);
|
||||
|
||||
// Loads Libraries
|
||||
$this->load->library('CmsLib');
|
||||
$this->load->library('PermissionLib');
|
||||
|
||||
// Loads phrases system
|
||||
$this->loadPhrases([
|
||||
@@ -83,10 +84,18 @@ class Cms extends Auth_Controller
|
||||
*/
|
||||
public function news($infoscreen = false, $studiengang_kz = null, $semester = null, $mischen = true, $titel = '', $edit = false, $sichtbar = true)
|
||||
{
|
||||
$viewData = array();
|
||||
$this->load->view('CisRouterView/CisRouterView.php', ['viewData'=>$viewData, 'route' => 'News']);
|
||||
$this->load->view('CisRouterView/CisRouterView.php', [
|
||||
'route' => 'News',
|
||||
]);
|
||||
}
|
||||
|
||||
public function newsAdministration()
|
||||
{
|
||||
$this->load->view('CisRouterView/CisRouterView.php', [
|
||||
'route' => 'NewsAdministration',
|
||||
]);
|
||||
}
|
||||
|
||||
public function getRoomInformation($ort_kurzbz)
|
||||
{
|
||||
// Load Config
|
||||
|
||||
@@ -143,7 +143,7 @@ class Documents extends Auth_Controller
|
||||
|
||||
$result = $this->VorlagestudiengangModel->getCurrent($xsl, $xsl_oe_kurzbz, $version);
|
||||
if (isError($result))
|
||||
show_error(getError($result));
|
||||
return show_error(getError($result));
|
||||
if (!hasData($result))
|
||||
return show_404();
|
||||
|
||||
@@ -226,13 +226,13 @@ class Documents extends Auth_Controller
|
||||
|
||||
$result = $this->VorlageModel->load($xsl);
|
||||
if (isError($result))
|
||||
show_error(getError($result));
|
||||
return show_error(getError($result));
|
||||
if (!hasData($result))
|
||||
show_404();
|
||||
|
||||
$vorlage = current(getData($result));
|
||||
if ($sign_user && !$vorlage->signierbar)
|
||||
show_error($this->p->t("stv", "grades_error_sign"));
|
||||
return show_error($this->p->t("stv", "grades_error_sign"));
|
||||
|
||||
|
||||
// Filename
|
||||
@@ -284,23 +284,11 @@ class Documents extends Auth_Controller
|
||||
// XML Data
|
||||
$result = $this->documentexportlib->getDataURL($xml, $params);
|
||||
if (isError($result))
|
||||
show_error(getError($result));
|
||||
return show_error(getError($result));
|
||||
|
||||
$data = getData($result);
|
||||
|
||||
// Get the content
|
||||
$contentResult = $this->documentexportlib->getContent($filename, $vorlage, $data, $xsl_oe_kurzbz, $version, $outputformat, $sign_user);
|
||||
|
||||
// If an error occurred
|
||||
if (isError($contentResult)) show_error(getError($contentResult));
|
||||
|
||||
$fileObj = new stdClass();
|
||||
$fileObj->file_content = getData($contentResult);
|
||||
$fileObj->name = $filename;
|
||||
$fileObj->mimetype = isEmptyString($vorlage->mimetype) ? 'application/pdf' : $vorlage->mimetype;
|
||||
$fileObj->disposition = 'attachment';
|
||||
|
||||
// Download
|
||||
$this->outputFile($fileObj);
|
||||
// Output
|
||||
$this->documentexportlib->showContent($filename, $vorlage, $data, $xsl_oe_kurzbz, $version, $outputformat, $sign_user);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1916,7 +1916,7 @@ class Abgabe extends FHCAPI_Controller
|
||||
|
||||
if (!$mailres)
|
||||
{
|
||||
$this->terminateWithError($this->p->t('abgabetool', 'c4fehlerMailBegutachterv2'), 'general');
|
||||
$this->terminateWithError($this->p->t('abgabetool', 'c4fehlerMailZweitBegutachterv2'), 'general');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2026 fhcomplete.org
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
if (!defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class Benutzer extends FHCAPI_Controller
|
||||
{
|
||||
|
||||
/**
|
||||
* Object initialization
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'getUserData' => self::PERM_LOGGED,
|
||||
]);
|
||||
|
||||
$this->load->model('person/Benutzer_model', 'BenutzerModel');
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
public function getUserData()
|
||||
{
|
||||
$uid = $this->input->get("uid") ?? getAuthUID();
|
||||
$this->BenutzerModel->addSelect("uid, person_id, insertamum");
|
||||
$userResult = $this->BenutzerModel->load(["uid" => $uid]);
|
||||
$userData = $this->getDataOrTerminateWithError($userResult);
|
||||
$this->terminateWithSuccess($userData);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,14 +36,15 @@ class Cms extends FHCAPI_Controller
|
||||
'ContentID' => self::PERM_LOGGED,
|
||||
'getOrtKurzbzContent' => self::PERM_LOGGED,
|
||||
'content' => self::PERM_LOGGED,
|
||||
'news' => self::PERM_LOGGED,
|
||||
'getNewsRowCount' => self::PERM_LOGGED,
|
||||
'newsForWidget' => self::PERM_LOGGED,
|
||||
'getNews' => self::PERM_LOGGED,
|
||||
|
||||
]);
|
||||
|
||||
$this->load->model('content/News_model', 'NewsModel');
|
||||
|
||||
$this->load->model('crm/Student_model', 'StudentModel');
|
||||
$this->load->model('crm/Prestudent_model', 'PrestudentModel');
|
||||
|
||||
// setting up the papgination_size
|
||||
$this->page_size = 10;
|
||||
|
||||
@@ -59,7 +60,6 @@ class Cms extends FHCAPI_Controller
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Private methods
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
@@ -106,7 +106,7 @@ class Cms extends FHCAPI_Controller
|
||||
$this->terminateWithSuccess($content_id);
|
||||
}
|
||||
|
||||
public function news()
|
||||
public function newsForWidget()
|
||||
{
|
||||
|
||||
// form validation
|
||||
@@ -118,7 +118,7 @@ class Cms extends FHCAPI_Controller
|
||||
$this->load->model('content/news_model', 'NewsModel');
|
||||
|
||||
$limit = $this->input->get('limit',TRUE);
|
||||
|
||||
|
||||
//query the news
|
||||
$news = $this->NewsModel->getAll($limit);
|
||||
|
||||
@@ -157,23 +157,7 @@ class Cms extends FHCAPI_Controller
|
||||
|
||||
}
|
||||
|
||||
public function getNewsRowCount($infoscreen = false, $studiengang_kz = null, $semester = null, $mischen = true, $titel = '', $fachbereich_kurzbz = null, $maxalter = 0, $edit = false, $sichtbar = true, $page = 1, $page_size = 10)
|
||||
{
|
||||
list($studiengang_kz, $semester) = $this->cmslib->getStgAndSem($studiengang_kz, $semester);
|
||||
$all = $edit;
|
||||
|
||||
$this->load->model('content/News_model','NewsModel');
|
||||
|
||||
$num_rows = $this->NewsModel->countNewsWithContent(getSprache(), $studiengang_kz, $semester, $fachbereich_kurzbz, $sichtbar, $maxalter, $page, $page_size, $all, $mischen);
|
||||
|
||||
$num_rows = $this->getDataOrTerminateWithError($num_rows);
|
||||
|
||||
$this->terminateWithSuccess($num_rows);
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function getNews($infoscreen = false, $studiengang_kz = null, $semester = null, $mischen = true, $titel = '', $edit = false, $sichtbar = true)
|
||||
public function getNews($infoscreen = false, $studiengang_kz = null, $semester = null, $mischen = false, $titel = '', $edit = false, $sichtbar = true)
|
||||
{
|
||||
//form validation
|
||||
$this->load->library('form_validation');
|
||||
@@ -193,15 +177,45 @@ class Cms extends FHCAPI_Controller
|
||||
|
||||
// default value for the page_size is 10
|
||||
$page_size = $page_size ?? 10;
|
||||
|
||||
$passedSichtbar = $this->input->get('published', true);
|
||||
if($passedSichtbar !== null)
|
||||
{
|
||||
$sichtbar = $passedSichtbar;
|
||||
}
|
||||
|
||||
$news = $this->cmslib->getNews($infoscreen, $studiengang_kz, $semester, $mischen, $titel, $edit, $sichtbar, $page, $page_size, $sprache);
|
||||
$filterForDegreePrograms = false;
|
||||
$entitledDegreePrograms = [];
|
||||
$student = $this->StudentModel->loadWhere(['student_uid' => getAuthUID()]);
|
||||
if(isError($student))
|
||||
{
|
||||
$this->terminateWithError(getError($student));
|
||||
}
|
||||
if(hasData($student))
|
||||
{
|
||||
$student = current(getData($student));
|
||||
|
||||
$degreeProgramSemesterDataResult = $this->PrestudentModel->getStudiengaengAndAusbildungssemesterByStudentUid(getAuthUID());
|
||||
$degreeProgramSemesterData = $this->getDataOrTerminateWithError($degreeProgramSemesterDataResult)[0];
|
||||
if ($degreeProgramSemesterData) {
|
||||
$studiengang_kz = isset($degreeProgramSemesterData->studiengang_kz) ? $degreeProgramSemesterData->studiengang_kz : null;
|
||||
$semester = isset($degreeProgramSemesterData->ausbildungssemester) ? $degreeProgramSemesterData->ausbildungssemester : null;
|
||||
}
|
||||
|
||||
$mischen = true;
|
||||
} else {
|
||||
$filterForDegreePrograms = true;
|
||||
$entitledDegreePrograms = $this->permissionlib->getSTG_isEntitledFor("basis/news");
|
||||
array_push($entitledDegreePrograms, 0);
|
||||
}
|
||||
|
||||
$news = $this->cmslib->getNews($infoscreen, $studiengang_kz, $semester, $mischen, $titel, $edit, $sichtbar, $page, $page_size, $sprache, $filterForDegreePrograms, $entitledDegreePrograms, true);
|
||||
$news = $this->getDataOrTerminateWithError($news);
|
||||
|
||||
$this->addMeta('phrases', json_decode($this->p->getJson()));
|
||||
$this->terminateWithSuccess($news);
|
||||
$this->addMeta('row_count', $news["row_count"] ?? 0);
|
||||
$this->terminateWithSuccess($news["content"]);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -51,8 +51,6 @@ class Documents extends FHCAPI_Controller
|
||||
$this->loadPhrases([
|
||||
'stv'
|
||||
]);
|
||||
|
||||
$this->load->library('DocumentExportLib');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -102,11 +100,23 @@ class Documents extends FHCAPI_Controller
|
||||
{
|
||||
$akteExportData = $this->_getAkteExportData($xml, $xsl, $sign_user);
|
||||
|
||||
$akteData = $akteExportData['akteData'];
|
||||
$exportData = $akteExportData['exportData'];
|
||||
$akteData = $akteData['akteData'];
|
||||
$exportData = $akteData['exportData'];
|
||||
|
||||
/**
|
||||
* [
|
||||
'vorlage' => $vorlage,
|
||||
'xml_data' => $data,
|
||||
'oe_kurzbz' => $xsl_oe_kurzbz,
|
||||
'version' => $version,
|
||||
'outputformat' => $outputformat,
|
||||
'sign_user' => $sign_user
|
||||
]
|
||||
*/
|
||||
|
||||
// Output
|
||||
$contentResult = $this->documentexportlib->getContent(
|
||||
$result = $this->documentexportlib->showContent(
|
||||
$akteData['akteData']['inhalt'],
|
||||
$exportData['vorlage'],
|
||||
$exportData['xml_data'],
|
||||
$exportData['oe_kurzbz'],
|
||||
@@ -115,9 +125,7 @@ class Documents extends FHCAPI_Controller
|
||||
$exportData['sign_user']
|
||||
);
|
||||
|
||||
$content = $this->getDataOrTerminateWithError($contentResult);
|
||||
|
||||
$this->terminateWithFileOutput($akteData['mimetype'], $content, $akteData['titel'] . '.pdf');
|
||||
$this->terminateWithSuccess(true);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -153,10 +161,12 @@ class Documents extends FHCAPI_Controller
|
||||
$this->load->library('form_validation');
|
||||
if (!$xml) {
|
||||
$xml = $this->input->post_get('xml');
|
||||
$this->addMeta('xml', $xml);
|
||||
$this->form_validation->set_rules('xml', 'xml', 'required');
|
||||
}
|
||||
if (!$xsl) {
|
||||
$xsl = $this->input->post_get('xsl');
|
||||
$this->addMeta('xsl', $xsl);
|
||||
$this->form_validation->set_rules('xsl', 'xsl', 'required');
|
||||
}
|
||||
|
||||
@@ -455,13 +465,18 @@ class Documents extends FHCAPI_Controller
|
||||
if ($sign_user && !$vorlage->signierbar)
|
||||
$this->terminateWithError($this->p->t("stv", "grades_error_sign"));
|
||||
|
||||
|
||||
$this->load->library('DocumentExportLib');
|
||||
|
||||
// XML Data
|
||||
$result = $this->documentexportlib->getDataURL($xml, $params);
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
$this->documentexportlib->addArchiveToData($data);
|
||||
$contentResult = $this->documentexportlib->getContent($vorlage, $data, $xsl_oe_kurzbz, $version, $outputformat, $sign_user);
|
||||
|
||||
$content = $this->getDataOrTerminateWithError($contentResult);
|
||||
// Output
|
||||
$result = $this->documentexportlib->getContent($vorlage, $data, $xsl_oe_kurzbz, $version, $outputformat, $sign_user);
|
||||
|
||||
$content = $this->getDataOrTerminateWithError($result);
|
||||
$akteData['titel'] .= '.pdf';
|
||||
$akteData['inhalt'] = base64_encode($content);
|
||||
|
||||
@@ -479,4 +494,3 @@ class Documents extends FHCAPI_Controller
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -18,18 +18,9 @@
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
//require_once('../../../include/studiengang.class.php');
|
||||
//require_once('../../../include/student.class.php');
|
||||
//require_once('../../../include/datum.class.php');
|
||||
//require_once('../../../include/mail.class.php');
|
||||
//require_once('../../../include/benutzerberechtigung.class.php');
|
||||
//require_once('../../../include/phrasen.class.php');
|
||||
//require_once('../../../include/projektarbeit.class.php');
|
||||
//require_once('../../../include/projektbetreuer.class.php');
|
||||
|
||||
class Lehre extends FHCAPI_Controller
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* Object initialization
|
||||
*/
|
||||
@@ -40,38 +31,56 @@ class Lehre extends FHCAPI_Controller
|
||||
'LV' => self::PERM_LOGGED,
|
||||
'Pruefungen' => self::PERM_LOGGED,
|
||||
'semesterAverageGrade' => self::PERM_LOGGED,
|
||||
'getZugewieseneLv' => self::PERM_LOGGED,
|
||||
'getLeForLv' => self::PERM_LOGGED
|
||||
]);
|
||||
|
||||
|
||||
$this->load->library('PhrasesLib');
|
||||
|
||||
$this->loadPhrases(
|
||||
array(
|
||||
'global',
|
||||
'ui',
|
||||
'abgabetool'
|
||||
)
|
||||
);
|
||||
|
||||
$this->load->helper('hlp_sancho_helper');
|
||||
|
||||
require_once(FHCPATH . 'include/studiengang.class.php');
|
||||
require_once(FHCPATH . 'include/student.class.php');
|
||||
require_once(FHCPATH . 'include/projektarbeit.class.php');
|
||||
require_once(FHCPATH . 'include/projektbetreuer.class.php');
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
/**
|
||||
/**
|
||||
* constructs the emails of the groups from a lehrveranstaltung
|
||||
*/
|
||||
public function lvStudentenMail()
|
||||
public function lvStudentenMail()
|
||||
{
|
||||
$lehreinheit_id = $this->input->get("lehreinheit_id",TRUE);
|
||||
|
||||
// return early if the required parameter is missing
|
||||
if(!isset($lehreinheit_id))
|
||||
{
|
||||
$this->terminateWithError('Missing required parameter', self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
$lehreinheit_id = $this->input->get("lehreinheit_id",TRUE);
|
||||
|
||||
$this->load->model('education/Lehreinheit_model', 'LehreinheitModel');
|
||||
|
||||
$studentenMails = $this->LehreinheitModel->getStudentenMail($lehreinheit_id);
|
||||
// return early if the required parameter is missing
|
||||
if(!isset($lehreinheit_id))
|
||||
{
|
||||
$this->terminateWithError('Missing required parameter', self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
|
||||
$studentenMails = $this->getDataOrTerminateWithError($studentenMails);
|
||||
$this->load->model('education/Lehreinheit_model', 'LehreinheitModel');
|
||||
|
||||
$studentenMails = $this->LehreinheitModel->getStudentenMail($lehreinheit_id);
|
||||
|
||||
$studentenMails = $this->getDataOrTerminateWithError($studentenMails);
|
||||
|
||||
//convert array of objects into array of strings
|
||||
$studentenMails = array_map(function($element){
|
||||
return $element->mail;
|
||||
}, $studentenMails);
|
||||
|
||||
$this->terminateWithSuccess($studentenMails);
|
||||
$this->terminateWithSuccess($studentenMails);
|
||||
}
|
||||
|
||||
public function LV($studiensemester_kurzbz, $lehrveranstaltung_id)
|
||||
@@ -81,13 +90,13 @@ class Lehre extends FHCAPI_Controller
|
||||
$result = $this->LehrveranstaltungModel->getLvsByStudentWithGrades(getAuthUID(), $studiensemester_kurzbz, getUserLanguage(), $lehrveranstaltung_id);
|
||||
|
||||
$result = current($this->getDataOrTerminateWithError($result));
|
||||
|
||||
|
||||
$this->terminateWithSuccess($result);
|
||||
}
|
||||
|
||||
/**
|
||||
* fetches all Pruefungen of a student for a specific lehrveranstaltung
|
||||
* if the student passed the Pruefung on the first attempt, no information about the Pruefungen is stored in the database
|
||||
* if the student passed the Pruefung on the first attempt, no information about the Pruefungen is stored in the database
|
||||
* @param mixed $lehrveranstaltung_id
|
||||
* @return void
|
||||
*/
|
||||
@@ -145,5 +154,46 @@ class Lehre extends FHCAPI_Controller
|
||||
|
||||
$this->terminateWithSuccess(['average_grade' => $averageGrade, 'weighted_average_grade' => $weightedAverageGrade]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* fetches all assigned lehrveranstaltungen of a mitarbeiter for a given semester
|
||||
* @param mixed $uid
|
||||
* @param mixed $sem_kurzbz
|
||||
* @return void
|
||||
*/
|
||||
public function getZugewieseneLv() {
|
||||
$uid = $this->input->get("uid",TRUE);
|
||||
$sem_kurzbz = $this->input->get("sem_kurzbz",TRUE);
|
||||
|
||||
// TODO: error messages
|
||||
|
||||
if(!isset($sem_kurzbz) || isEmptyString($sem_kurzbz))
|
||||
$this->terminateWithError($this->p->t('global', 'wrongParameters'), 'general');
|
||||
|
||||
if (!isset($uid) || isEmptyString($uid))
|
||||
$uid = getAuthUID();
|
||||
|
||||
// querying other ma_uids data requires admin permission
|
||||
if($uid !== getAuthUID()) {
|
||||
$this->load->library('PermissionLib');
|
||||
$isAdmin = $this->permissionlib->isBerechtigt('admin');
|
||||
if(!$isAdmin) $this->terminateWithError($this->p->t('ui', 'keineBerechtigung'), 'general');
|
||||
}
|
||||
|
||||
$this->load->model('education/Lehrveranstaltung_model', 'LehrveranstaltungModel');
|
||||
$result = $this->LehrveranstaltungModel->getLvForLektorInSemester($sem_kurzbz, $uid);
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
public function getLeForLv() {
|
||||
$lv_id = $this->input->get("lv_id",TRUE);
|
||||
$sem_kurzbz = $this->input->get("sem_kurzbz",TRUE);
|
||||
|
||||
$this->load->model('education/Lehreinheit_model', 'LehreinheitModel');
|
||||
|
||||
// $this->terminateWithSuccess($this->LehreinheitModel->getLesForLv($lv_id, $sem_kurzbz));
|
||||
$this->terminateWithSuccess($this->LehreinheitModel->getAllLehreinheitenForLvaAndMaUid($lv_id, getAuthUID(), $sem_kurzbz));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -28,7 +28,10 @@ class Lehrveranstaltung extends FHCAPI_Controller
|
||||
{
|
||||
parent::__construct([
|
||||
'getByEmp' => ['admin:r', 'assistenz:r'],
|
||||
'getByLe' => ['admin:r', 'assistenz:r'],
|
||||
'getByLv' => ['admin:r', 'assistenz:r'],
|
||||
'getByStg' => ['admin:r', 'assistenz:r'],
|
||||
'getByStgOrgform' => ['admin:r', 'assistenz:r'],
|
||||
'loadByLV' => ['admin:r', 'assistenz:r'],
|
||||
]);
|
||||
|
||||
@@ -77,41 +80,117 @@ class Lehrveranstaltung extends FHCAPI_Controller
|
||||
|
||||
$this->terminateWithSuccess($tree);
|
||||
}
|
||||
|
||||
public function getByLe($studiensemester_kurzbz = null, $lehreinheit_id = null)
|
||||
{
|
||||
if (is_null($lehreinheit_id))
|
||||
$this->terminateWithError($this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
$studiensemester_kurzbz = $this->getStudiensemesterKurzbz($studiensemester_kurzbz);
|
||||
|
||||
|
||||
$lehreinheiten = $this->_ci->LehreinheitModel->getByLeStudiensemester($lehreinheit_id, $studiensemester_kurzbz);
|
||||
$lehreinheiten_data = $this->getDataOrTerminateWithError($lehreinheiten);
|
||||
|
||||
$this->terminateWithSuccess($lehreinheiten_data);
|
||||
}
|
||||
|
||||
public function getByLv($studiensemester_kurzbz = null, $lehrveranstaltung_id = null)
|
||||
{
|
||||
if (is_null($lehrveranstaltung_id))
|
||||
$this->terminateWithError($this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
$studiensemester_kurzbz = $this->getStudiensemesterKurzbz($studiensemester_kurzbz);
|
||||
|
||||
$tree = [];
|
||||
|
||||
$this->_ci->LehrveranstaltungModel->addSelect('studiengang_kz');
|
||||
$lv = $this->_ci->LehrveranstaltungModel->load($lehrveranstaltung_id);
|
||||
$lv = $this->getDataOrTerminateWithError($lv);
|
||||
|
||||
if (empty($lv))
|
||||
$this->terminateWithError($this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
$lehrveranstaltungen_data = array();
|
||||
foreach ($this->_loadLvRows(current($lv)->studiengang_kz, $studiensemester_kurzbz) as $row)
|
||||
{
|
||||
if ((string)$row->lehrveranstaltung_id === (string)$lehrveranstaltung_id)
|
||||
{
|
||||
$lehrveranstaltungen_data[] = $row;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($lehrveranstaltungen_data))
|
||||
{
|
||||
|
||||
$this->_ci->LehrveranstaltungModel->addSelect('
|
||||
tbl_lehrveranstaltung.*,
|
||||
tbl_lehrveranstaltung.kurzbz as lv_kurzbz,
|
||||
lehrveranstaltung_id,
|
||||
lehrtyp_kurzbz,
|
||||
studiengang_kz as lv_studiengang_kz,
|
||||
UPPER(CONCAT(tbl_studiengang.typ, tbl_studiengang.kurzbz)) as studiengang,
|
||||
semester as semester,
|
||||
tbl_lehrveranstaltung.bezeichnung as lv_bezeichnung,
|
||||
ects as lv_ects,
|
||||
lehreverzeichnis as lv_lehreverzeichnis,
|
||||
planfaktor as lv_planfaktor,
|
||||
planlektoren as lv_planlektoren,
|
||||
planpersonalkosten as lv_planpersonalkosten,
|
||||
plankostenprolektor as lv_plankostenprolektor,
|
||||
tbl_lehrveranstaltung.orgform_kurzbz as orgform_kurzbz,
|
||||
tbl_lehrveranstaltung.sprache as sprache,
|
||||
lehrform_kurzbz as lv_lehrform_kurzbz,
|
||||
tbl_lehrveranstaltung.bezeichnung_english as lv_bezeichnung_english,
|
||||
semesterstunden as lv_semesterstunden,
|
||||
');
|
||||
$this->_ci->LehrveranstaltungModel->addJoin('public.tbl_studiengang', 'studiengang_kz');
|
||||
$lehrveranstaltungen = $this->_ci->LehrveranstaltungModel->load($lehrveranstaltung_id);
|
||||
$lehrveranstaltungen_data = $this->getDataOrTerminateWithError($lehrveranstaltungen);
|
||||
}
|
||||
|
||||
foreach ($lehrveranstaltungen_data as $lehrveranstaltung)
|
||||
{
|
||||
$lehreinheiten = $this->_ci->LehreinheitModel->getByLvidStudiensemester($lehrveranstaltung->lehrveranstaltung_id, $studiensemester_kurzbz);
|
||||
$lehreinheiten_data = $this->getDataOrTerminateWithError($lehreinheiten);
|
||||
|
||||
if (!isset($lehrveranstaltung->_children))
|
||||
{
|
||||
$lehrveranstaltung->_children = $lehreinheiten_data;
|
||||
}
|
||||
$tree[] = $lehrveranstaltung;
|
||||
}
|
||||
|
||||
$counter = 0;
|
||||
$this->assignUniqueIndex($tree, $counter);
|
||||
$this->terminateWithSuccess($tree);
|
||||
}
|
||||
|
||||
public function getByStg($studiensemester_kurzbz = null, $stg_kz = null, $semester = null)
|
||||
{
|
||||
$this->_getLvTree($studiensemester_kurzbz, $stg_kz, $semester, null);
|
||||
}
|
||||
|
||||
public function getByStgOrgform($studiensemester_kurzbz = null, $stg_kz = null, $orgform = null, $semester = null)
|
||||
{
|
||||
$orgform_kurzbz = $this->getOrgformKurzbz($orgform);
|
||||
$this->_getLvTree($studiensemester_kurzbz, $stg_kz, $semester, $orgform_kurzbz);
|
||||
}
|
||||
|
||||
private function _getLvTree($studiensemester_kurzbz, $stg_kz, $semester, $orgform_kurzbz)
|
||||
{
|
||||
$studiengang_kz = $this->getStudiengangKz($stg_kz);
|
||||
|
||||
if (is_null($studiengang_kz) || !preg_match("/^(-?[1-9][0-9]*|0)$/", (string)$studiengang_kz))
|
||||
$this->terminateWithError($this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
$verband = null;
|
||||
if (!is_null($semester) && !is_numeric($semester))
|
||||
{
|
||||
$verband = $this->getOrgformKurzbz($semester);
|
||||
$semester = null;
|
||||
}
|
||||
|
||||
$this->_ci->load->model('organisation/Studienplan_model', 'StudienplanModel');
|
||||
if (!is_null($semester) && !ctype_digit((string)$semester))
|
||||
$this->terminateWithError($this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
$studiensemester_kurzbz = $this->getStudiensemesterKurzbz($studiensemester_kurzbz);
|
||||
$studienplan_data = $this->_ci->StudienplanModel->getStudienplaeneBySemester($studiengang_kz, $studiensemester_kurzbz, $semester, $verband);
|
||||
|
||||
$studienplan_ids = array();
|
||||
$only_ids = array();
|
||||
$placeholders = array();
|
||||
|
||||
if (hasData($studienplan_data))
|
||||
{
|
||||
foreach (getData($studienplan_data) as $studienplan) {
|
||||
$placeholders[] = "(?, ?)";
|
||||
$studienplan_ids[] = $studienplan->studienplan_id;
|
||||
$studienplan_ids[] = $studienplan->semester;
|
||||
$only_ids[] = $studienplan->studienplan_id;
|
||||
}
|
||||
}
|
||||
|
||||
$lehrveranstaltungen_data = $this->_ci->LehrveranstaltungModel->getLvsByStudiengang($studienplan_ids, $placeholders, $only_ids, $studiengang_kz, $studiensemester_kurzbz, $semester, $verband);
|
||||
$lehrveranstaltungen_data = hasData($lehrveranstaltungen_data) ? getData($lehrveranstaltungen_data) : array();
|
||||
$lehrveranstaltungen_data = $this->_loadLvRows($studiengang_kz, $studiensemester_kurzbz, $semester, $orgform_kurzbz);
|
||||
|
||||
$tree = [];
|
||||
foreach ($lehrveranstaltungen_data as $row)
|
||||
@@ -244,6 +323,31 @@ class Lehrveranstaltung extends FHCAPI_Controller
|
||||
|
||||
$this->LehreinheitModel->getLvsByFachbereich($fachbereich, $studiensemester_kurzbz, $mitarbeiter_uid);
|
||||
}*/
|
||||
|
||||
private function _loadLvRows($studiengang_kz, $studiensemester_kurzbz, $semester = null, $orgform_kurzbz = null)
|
||||
{
|
||||
$this->_ci->load->model('organisation/Studienplan_model', 'StudienplanModel');
|
||||
|
||||
$studienplan_data = $this->_ci->StudienplanModel->getStudienplaeneBySemester($studiengang_kz, $studiensemester_kurzbz, $semester, $orgform_kurzbz);
|
||||
|
||||
$studienplan_ids = array();
|
||||
$only_ids = array();
|
||||
$placeholders = array();
|
||||
|
||||
if (hasData($studienplan_data))
|
||||
{
|
||||
foreach (getData($studienplan_data) as $studienplan) {
|
||||
$placeholders[] = "(?, ?)";
|
||||
$studienplan_ids[] = $studienplan->studienplan_id;
|
||||
$studienplan_ids[] = $studienplan->semester;
|
||||
$only_ids[] = $studienplan->studienplan_id;
|
||||
}
|
||||
}
|
||||
|
||||
$lehrveranstaltungen_data = $this->_ci->LehrveranstaltungModel->getLvsByStudiengang($studienplan_ids, $placeholders, $only_ids, $studiengang_kz, $studiensemester_kurzbz, $semester, $orgform_kurzbz);
|
||||
return hasData($lehrveranstaltungen_data) ? getData($lehrveranstaltungen_data) : array();
|
||||
}
|
||||
|
||||
private function _setAuthUID()
|
||||
{
|
||||
$this->_uid = getAuthUID();
|
||||
@@ -309,8 +413,8 @@ class Lehrveranstaltung extends FHCAPI_Controller
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
if (!$data)
|
||||
return $orgform_kurzbz;
|
||||
$this->terminateWithError($this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
return current($data)->orgform_kurzbz;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -36,7 +36,8 @@ class LvMenu extends FHCAPI_Controller
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'getLvMenu' => self::PERM_LOGGED
|
||||
'getLvMenu' => self::PERM_LOGGED,
|
||||
'getMultipleLvMenu' => self::PERM_LOGGED
|
||||
]);
|
||||
|
||||
$this->load->model("ressource/Mitarbeiter_model");
|
||||
@@ -61,24 +62,23 @@ class LvMenu extends FHCAPI_Controller
|
||||
|
||||
/**
|
||||
* alternative function to get multiple lvMenus with a single http request
|
||||
* not yet working as intended as the menu_lv.inc.php scripts called by the
|
||||
* lvMenuBuild event have logic coupled to require_once import which results in
|
||||
* a wrong logic after the first invocation -> faulty results for lvinfo, moodle
|
||||
* and several others
|
||||
*/
|
||||
public function getMultipleLvMenu($lvMenuOptionList){
|
||||
public function getMultipleLvMenu(){
|
||||
$lvMenuOptionList = $this->input->post('lvMenuOptionList', true);
|
||||
$result =[];
|
||||
foreach($lvMenuOptionList as $lvMenuOptions){
|
||||
$lvMenu = $this->getLvMenu($lvMenuOptions['lvid'],$lvMenuOptions['studiensemester_kurzbz']);
|
||||
if(isError($lvMenu)){
|
||||
// TODO: some lvMenu threw an error, handle error here
|
||||
}
|
||||
$lvMenu = $this->getLvMenuInternal($lvMenuOptions['lvid'],$lvMenuOptions['studiensemester_kurzbz']);
|
||||
|
||||
$result[$lvMenuOptions['lvid']]=$lvMenu;
|
||||
}
|
||||
$this->terminateWithSuccess($result);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function getLvMenu($lvid, $studiensemester_kurzbz)
|
||||
{
|
||||
|
||||
private function getLvMenuInternal($lvid, $studiensemester_kurzbz) {
|
||||
|
||||
// return early if parameters are missing
|
||||
if(!isset($lvid) || !isset($studiensemester_kurzbz))
|
||||
@@ -89,14 +89,14 @@ class LvMenu extends FHCAPI_Controller
|
||||
|
||||
// get the user
|
||||
if (!$user=getAuthUID())
|
||||
$this->terminateWithError($this->p->t('global', 'nichtAngemeldet'));
|
||||
$this->terminateWithError($this->p->t('global', 'nichtAngemeldet'));
|
||||
|
||||
// check if is_lector
|
||||
$is_lector = false;
|
||||
$mares = $this->Mitarbeiter_model->isMitarbeiter($user);
|
||||
if(hasData($mares))
|
||||
{
|
||||
$is_lector = getData($mares);
|
||||
$is_lector = getData($mares);
|
||||
}
|
||||
|
||||
// definition of user_is_allowed_to_upload
|
||||
@@ -105,7 +105,7 @@ class LvMenu extends FHCAPI_Controller
|
||||
|
||||
// load lehrveranstaltung
|
||||
$lvres = $this->Lehrveranstaltung_model->load($lvid);
|
||||
if(!hasData($lvres))
|
||||
if(!hasData($lvres))
|
||||
{
|
||||
$this->terminateWithError('LV ' . $lvid . ' not found.');
|
||||
}
|
||||
@@ -124,7 +124,7 @@ class LvMenu extends FHCAPI_Controller
|
||||
$stgres = $this->Studiengang_model->load(strval($studiengang_kz));
|
||||
if(!hasData($stgres))
|
||||
{
|
||||
$this->terminateWithError('Stg ' . $lv->studiengang_kz . ' not found.');
|
||||
$this->terminateWithError('Stg ' . $lv->studiengang_kz . ' not found.');
|
||||
}
|
||||
$stg = (getData($stgres))[0];
|
||||
$kurzbz = strtoupper($stg->typ . $stg->kurzbz);
|
||||
@@ -139,7 +139,7 @@ class LvMenu extends FHCAPI_Controller
|
||||
$angemeldet = false;
|
||||
|
||||
$lesres = $this->Lehreinheit_model->getLehreinheitenForStudentAndStudienSemester(
|
||||
$lvid, $user, $angezeigtes_stsem
|
||||
$lvid, $user, $angezeigtes_stsem
|
||||
);
|
||||
|
||||
if(hasData($lesres) && count(getData($lesres)) > 0)
|
||||
@@ -148,7 +148,7 @@ class LvMenu extends FHCAPI_Controller
|
||||
|
||||
// lehrfach
|
||||
$lehrfach_id='';
|
||||
|
||||
|
||||
if(defined('CIS_LEHRVERANSTALTUNG_LEHRFACH_ANZEIGEN') && CIS_LEHRVERANSTALTUNG_LEHRFACH_ANZEIGEN)
|
||||
{
|
||||
// Wenn der eingeloggte User zu einer der Lehreinheiten zugeteilt ist
|
||||
@@ -211,8 +211,8 @@ class LvMenu extends FHCAPI_Controller
|
||||
foreach($fbs as $row)
|
||||
{
|
||||
$lehrfach_oe_kurzbz_arr[] = $row->oe_kurzbz;
|
||||
if($this->PermissionLib->isBerechtigt('lehre', null, $row->oe_kurzbz)
|
||||
|| $this->PermissionLib->isBerechtigt('assistenz', null, $stg->oe_kurzbz))
|
||||
if($this->PermissionLib->isBerechtigt('lehre', null, $row->oe_kurzbz)
|
||||
|| $this->PermissionLib->isBerechtigt('assistenz', null, $stg->oe_kurzbz))
|
||||
{
|
||||
$user_is_allowed_to_upload=true;
|
||||
}
|
||||
@@ -224,21 +224,21 @@ class LvMenu extends FHCAPI_Controller
|
||||
$menu = array();
|
||||
|
||||
$this->fhc_menu_lvinfo($menu, $lvid, $studiengang_kz, $lektor_der_lv, $is_lector, $lehrfach_oe_kurzbz_arr);
|
||||
|
||||
|
||||
$this->fhc_menu_feedback($menu, $angemeldet, $lvid);
|
||||
|
||||
|
||||
$this->fhc_menu_gesamtnote($menu, $angemeldet, $lvid, $lv, $is_lector, $angezeigtes_stsem);
|
||||
|
||||
|
||||
$this->fhc_menu_emailStudierende($menu, $user, $angemeldet, $lvid, $angezeigtes_stsem);
|
||||
|
||||
|
||||
$this->fhc_menu_abmeldung($menu, $user, $is_lector, $lvid, $angezeigtes_stsem);
|
||||
|
||||
|
||||
$this->fhc_menu_lehretools($menu, $lvid, $angezeigtes_stsem, $sprache);
|
||||
|
||||
|
||||
$this->fhc_menu_anrechnungStudent($menu, $lvid, $angezeigtes_stsem);
|
||||
|
||||
|
||||
$this->fhc_menu_anrechnungLector($menu, $angezeigtes_stsem);
|
||||
|
||||
|
||||
|
||||
// Addons Menu Logic
|
||||
// ##########################################################################################
|
||||
@@ -272,18 +272,18 @@ class LvMenu extends FHCAPI_Controller
|
||||
'permissionLib' => &$this->PermissionLib,
|
||||
'phrasesLib' => &$this->PhrasesLib
|
||||
];
|
||||
|
||||
Events::trigger('lvMenuBuild',
|
||||
// passing $menu per reference
|
||||
function & () use (&$menu) {
|
||||
return $menu;
|
||||
},
|
||||
$params
|
||||
|
||||
Events::trigger('lvMenuBuild',
|
||||
// passing $menu per reference
|
||||
function & () use (&$menu) {
|
||||
return $menu;
|
||||
},
|
||||
$params
|
||||
);
|
||||
|
||||
// Menu sortieren
|
||||
// ##########################################################################################
|
||||
|
||||
|
||||
foreach ($menu as $key => $row){
|
||||
|
||||
// removes menu points that are not needed in the c4 lvUebersicht
|
||||
@@ -291,7 +291,7 @@ class LvMenu extends FHCAPI_Controller
|
||||
unset($menu[$key]);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
// fills pos array to sort the menu
|
||||
$pos[$key] = $row['position'];
|
||||
|
||||
@@ -299,11 +299,18 @@ class LvMenu extends FHCAPI_Controller
|
||||
|
||||
array_multisort($pos, SORT_ASC, SORT_NUMERIC, $menu);
|
||||
|
||||
// HTTP response
|
||||
// ##########################################################################################
|
||||
|
||||
return $menu;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function getLvMenu($lvid, $studiensemester_kurzbz)
|
||||
{
|
||||
$menu = $this->getLvMenuInternal($lvid, $studiensemester_kurzbz);
|
||||
|
||||
$this->terminateWithSuccess($menu);
|
||||
|
||||
}
|
||||
|
||||
private function fhc_menu_lvinfo(&$menu, $lvid, $studiengang_kz, $lektor_der_lv, $is_lector, $lehrfach_oe_kurzbz_arr){
|
||||
@@ -372,7 +379,8 @@ class LvMenu extends FHCAPI_Controller
|
||||
'name'=>$this->p->t('lehre', 'gesamtnote'),
|
||||
'phrase' => 'lehre/gesamtnote',
|
||||
'c4_icon'=> base_url('skin/images/button_endnote.png'),
|
||||
'c4_link'=> base_url('cis/private/lehre/benotungstool/lvgesamtnoteverwalten.php?lvid='.urlencode($lvid).'&stsem='.urlencode($angezeigtes_stsem))
|
||||
'c4_link'=> site_url('Cis/Benotungstool/'.urlencode($lvid).'/'.urlencode($angezeigtes_stsem))
|
||||
//'c4_link'=> base_url('cis/private/lehre/benotungstool/lvgesamtnoteverwalten.php?lvid='.urlencode($lvid).'&stsem='.urlencode($angezeigtes_stsem))
|
||||
//'c4_link'=> base_url('benotungstool/lvgesamtnoteverwalten.php?lvid='.urlencode($lvid).'&stsem='.urlencode($angezeigtes_stsem))
|
||||
);
|
||||
}
|
||||
@@ -541,4 +549,4 @@ class LvMenu extends FHCAPI_Controller
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,167 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class MaZeitsperren extends FHCAPI_Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'getAllActiveZeitsperren' => ['cis/andere_zeitsperren:r', 'admin:r', 'assistenz:r'],
|
||||
'getAllZeitsperrenFixeMa' => ['cis/andere_zeitsperren:r', 'admin:r', 'assistenz:r'],
|
||||
'getAllZeitsperrenLector' => ['cis/andere_zeitsperren:r', 'admin:r', 'assistenz:r'],
|
||||
'getAllZeitsperrenOes' => ['cis/andere_zeitsperren:r', 'admin:r', 'assistenz:r'],
|
||||
'getZeitsperrenAss' => ['cis/andere_zeitsperren:r', 'admin:r', 'assistenz:r'],
|
||||
'getStgLectors' => self::PERM_LOGGED,
|
||||
'loadZeitsperrenLectorStg' => ['cis/andere_zeitsperren:r', 'admin:r', 'assistenz:r'],
|
||||
'loadZeitsperrenMa' => ['cis/andere_zeitsperren:r', 'admin:r', 'assistenz:r'],
|
||||
'getDetailsMa' => self::PERM_LOGGED
|
||||
]);
|
||||
|
||||
// Load Libraries
|
||||
$this->load->library('VariableLib', ['uid' => getAuthUID()]);
|
||||
$this->load->library('form_validation');
|
||||
|
||||
// Load language phrases
|
||||
$this->loadPhrases([
|
||||
'ui',
|
||||
'person',
|
||||
'zeitsperren'
|
||||
]);
|
||||
|
||||
// Load models
|
||||
$this->load->model('ressource/Zeitsperre_model', 'ZeitsperreModel');
|
||||
}
|
||||
|
||||
//only user with zeitsperren
|
||||
public function getAllActiveZeitsperren($days)
|
||||
{
|
||||
$result = $this->ZeitsperreModel->getZeitsperrenForNextDays($days);
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
//TODO: check query: more results after join with hr-table
|
||||
//all fixe Ma
|
||||
public function getAllZeitsperrenFixeMa($days)
|
||||
{
|
||||
$von = date('Y-m-d');
|
||||
$bis = date('Y-m-d', strtotime("+{$days} days"));
|
||||
$result = $this->ZeitsperreModel->getMitarbeiterWithZeitsperren($von, $bis, true, false, null, false);
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
public function getAllZeitsperrenLector($days)
|
||||
{
|
||||
$von = date('Y-m-d');
|
||||
$bis = date('Y-m-d', strtotime("+{$days} days"));
|
||||
$result = $this->ZeitsperreModel->getMitarbeiterWithZeitsperren($von, $bis, false, true, null, false);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
public function getZeitsperrenAss($days)
|
||||
{
|
||||
$von = date('Y-m-d');
|
||||
$bis = date('Y-m-d', strtotime("+{$days} days"));
|
||||
$result = $this->ZeitsperreModel->getMitarbeiterWithZeitsperren($von, $bis, false, false, null, true);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
public function getAllZeitsperrenOes($days, $oe)
|
||||
{
|
||||
if(!$oe)
|
||||
{
|
||||
return $this->terminateWithError($this->p->t('ui', 'error_missingId', ['id'=> 'OE Kurzbezeichnung']), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
$von = date('Y-m-d');
|
||||
$bis = date('Y-m-d', strtotime("+{$days} days"));
|
||||
$result = $this->ZeitsperreModel->getMitarbeiterWithZeitsperren($von, $bis, false, false, $oe, false);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
public function loadZeitsperrenLectorStg($days, $stg)
|
||||
{
|
||||
if(!$stg)
|
||||
{
|
||||
return $this->terminateWithError($this->p->t('ui', 'error_missingId', ['id'=> 'Studiengangskennzahl']), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
if(!is_numeric($stg))
|
||||
{
|
||||
return $this->terminateWithError($this->p->t('ui', 'error_paramNoNumber', ['param'=> 'Studiengangskennzahl']), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
|
||||
$von = date('Y-m-d');
|
||||
$bis = date('Y-m-d', strtotime("+{$days} days"));
|
||||
$result = $this->ZeitsperreModel->getMitarbeiterWithZeitsperren($von, $bis, false, true, false, false, $stg);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
public function getStgLectors()
|
||||
{
|
||||
$sql = "
|
||||
select
|
||||
studiengang_kz,
|
||||
kurzbz,
|
||||
kurzbzlang,
|
||||
typ,
|
||||
bezeichnung,
|
||||
kurzbzlang || ' (' || bezeichnung || ')' AS label,
|
||||
aktiv
|
||||
from
|
||||
public.tbl_studiengang
|
||||
where
|
||||
typ in ('b','m')
|
||||
order by typ asc, kurzbz Asc
|
||||
";
|
||||
|
||||
$this->load->model('organisation/Studiengang_model', 'StudiengangModel');
|
||||
$result = $this->StudiengangModel->execReadOnlyQuery($sql);
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
public function loadZeitsperrenMa($days, $uid)
|
||||
{
|
||||
if ($uid === null || $uid === '')
|
||||
{
|
||||
return $this->terminateWithError($this->p->t('ui', 'error_missingId', ['id'=> 'Mitarbeiter UID']), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
$result = $this->ZeitsperreModel->getZeitsperrenForNextDays($days, $uid);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
public function getDetailsMa($uid)
|
||||
{
|
||||
if ($uid === null || $uid === '')
|
||||
{
|
||||
$this->terminateWithError($this->p->t('ui', 'error_missingId', ['id'=> 'Mitarbeiter UID']), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
$this->load->model('person/Person_model', 'PersonModel');
|
||||
$result = $this->PersonModel->getFullName($uid);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,948 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2026 fhcomplete.org
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
if (!defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class NewsAdministrationAPI extends FHCAPI_Controller
|
||||
{
|
||||
/**
|
||||
* News API constructor.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'getNews' => 'basis/news:r',
|
||||
'getNewsItem' => 'basis/news:r',
|
||||
'storeNewsItem' => 'basis/news:w',
|
||||
'updateNewsItem' => 'basis/news:w',
|
||||
'deleteNewsItem' => 'basis/news:w'
|
||||
]);
|
||||
|
||||
$this->load->model('content/Content_model', 'ContentModel');
|
||||
$this->load->model('content/Contentsprache_model', 'ContentspracheModel');
|
||||
$this->load->model('content/News_model', 'NewsModel');
|
||||
$this->load->model('organisation/Studiengang_model', 'StudiengangModel');
|
||||
$this->load->model('ressource/Mitarbeiter_model', 'MitarbeiterModel');
|
||||
$this->load->model('system/Sprache_model', 'SpracheModel');
|
||||
$this->load->model('person/Benutzerfunktion_model', 'BenutzerfunktionModel');
|
||||
|
||||
$this->loadPhrases([
|
||||
'global'
|
||||
]);
|
||||
|
||||
$this->load->library('CmsLib');
|
||||
|
||||
$this->load->helper('hlp_sancho_helper');
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
public function getNews($infoscreen = false, $studiengang_kz = null, $semester = null, $titel = '', $active = true, $sichtbar = true)
|
||||
{
|
||||
$this->load->library('form_validation');
|
||||
$this->form_validation->set_data($_GET);
|
||||
$this->form_validation->set_rules('page','Page','required|is_natural');
|
||||
$this->form_validation->set_rules('page_size', 'PageSize', 'is_natural');
|
||||
if($this->form_validation->run() == FALSE) $this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
|
||||
$page = intval($this->input->get('page', true));
|
||||
$page_size = intval($this->input->get('page_size', true));
|
||||
$sprache = $this->input->get('sprache', true);
|
||||
if(!$sprache)
|
||||
{
|
||||
$sprache = getUserLanguage();
|
||||
}
|
||||
|
||||
// default value for the page_size is 10
|
||||
$page_size = $page_size ?? 10;
|
||||
|
||||
$passedSichtbar = $this->input->get('published', true);
|
||||
if($passedSichtbar !== null)
|
||||
{
|
||||
$sichtbar = $passedSichtbar;
|
||||
}
|
||||
|
||||
$passedIsActive = $this->input->get('isActive', true);
|
||||
if ($passedIsActive !== null)
|
||||
{
|
||||
$isActive = filter_var(
|
||||
$passedIsActive,
|
||||
FILTER_VALIDATE_BOOLEAN,
|
||||
FILTER_NULL_ON_FAILURE
|
||||
);
|
||||
if ($isActive !== null)
|
||||
{
|
||||
$active = $isActive;
|
||||
}
|
||||
}
|
||||
|
||||
$degreeProgramShortCode = $this->input->get('degreeProgramShortCode', true);
|
||||
if ($degreeProgramShortCode !== null && $degreeProgramShortCode !== '')
|
||||
{
|
||||
if (!ctype_digit((string)$degreeProgramShortCode))
|
||||
{
|
||||
$this->terminateWithValidationErrors([
|
||||
'degreeProgramShortCode' => 'A valid degree program is required'
|
||||
]);
|
||||
}
|
||||
$studiengang_kz = $degreeProgramShortCode;
|
||||
}
|
||||
|
||||
$passedSemester = $this->input->get('semester', true);
|
||||
if ($passedSemester !== null && $passedSemester !== '')
|
||||
{
|
||||
if (
|
||||
!ctype_digit((string)$passedSemester)
|
||||
|| (int)$passedSemester < 1
|
||||
|| (int)$passedSemester > 8
|
||||
)
|
||||
{
|
||||
$this->terminateWithValidationErrors([
|
||||
'semester' => 'A valid semester is required'
|
||||
]);
|
||||
}
|
||||
$semester = filter_var($passedSemester, FILTER_VALIDATE_INT);
|
||||
}
|
||||
|
||||
$entitledDegreePrograms = $this->permissionlib->getSTG_isEntitledFor("basis/news");
|
||||
|
||||
$news = $this->cmslib->getNews($infoscreen, $studiengang_kz, $semester, false, $titel, true, $sichtbar, $page, $page_size, $sprache, true, $entitledDegreePrograms, $active);
|
||||
$news = $this->getDataOrTerminateWithError($news);
|
||||
|
||||
$this->addMeta('row_count', $news["row_count"] ?? 0);
|
||||
$this->terminateWithSuccess($news["content"]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns one news entry with all available language versions for editing.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function getNewsItem($newsId)
|
||||
{
|
||||
if (!is_numeric($newsId) || (int)$newsId < 1)
|
||||
{
|
||||
$this->terminateWithValidationErrors([
|
||||
'newsId' => 'A valid news ID is required'
|
||||
]);
|
||||
}
|
||||
|
||||
$newsId = (int)$newsId;
|
||||
$newsResult = $this->NewsModel->load($newsId);
|
||||
|
||||
if (isError($newsResult))
|
||||
{
|
||||
$this->terminateWithError(getError($newsResult), self::ERROR_TYPE_DB);
|
||||
}
|
||||
|
||||
if (!hasData($newsResult))
|
||||
{
|
||||
$this->terminateWithValidationErrors([
|
||||
'newsId' => 'The requested news entry does not exist'
|
||||
]);
|
||||
}
|
||||
|
||||
$news = current(getData($newsResult));
|
||||
$entitledDegreePrograms = $this->permissionlib->getSTG_isEntitledFor("basis/news");
|
||||
|
||||
if (!in_array($news->studiengang_kz, $entitledDegreePrograms)) {
|
||||
$this->terminateWithError('You are not entitled to access this news entry', self::ERROR_TYPE_PERMISSION);
|
||||
}
|
||||
$translationsResult = $this->ContentspracheModel->loadWhere([
|
||||
'content_id' => $news->content_id
|
||||
]);
|
||||
|
||||
if (isError($translationsResult))
|
||||
{
|
||||
$this->terminateWithError(getError($translationsResult), self::ERROR_TYPE_DB);
|
||||
}
|
||||
|
||||
$languages = [];
|
||||
|
||||
foreach ((array)getData($translationsResult) as $translation)
|
||||
{
|
||||
$languages[$translation->sprache] = true;
|
||||
}
|
||||
|
||||
$translations = [];
|
||||
|
||||
foreach (array_keys($languages) as $language)
|
||||
{
|
||||
$contentResult = $this->ContentModel->getContent(
|
||||
$news->content_id,
|
||||
$language,
|
||||
null,
|
||||
null,
|
||||
false
|
||||
);
|
||||
|
||||
if (isError($contentResult))
|
||||
{
|
||||
$this->terminateWithError(getError($contentResult), self::ERROR_TYPE_DB);
|
||||
}
|
||||
|
||||
$content = getData($contentResult);
|
||||
$document = new DOMDocument('1.0', 'UTF-8');
|
||||
|
||||
if ($content->content !== '' && $document->loadXML($content->content) === false)
|
||||
{
|
||||
$this->terminateWithError(
|
||||
'The stored news content is invalid',
|
||||
self::ERROR_TYPE_GENERAL
|
||||
);
|
||||
}
|
||||
|
||||
$author = $document->getElementsByTagName('verfasser')->item(0);
|
||||
$title = $document->getElementsByTagName('betreff')->item(0);
|
||||
$text = $document->getElementsByTagName('text')->item(0);
|
||||
|
||||
$translations[] = [
|
||||
'language' => $language,
|
||||
'author' => $author ? $author->nodeValue : '',
|
||||
'title' => $title ? $title->nodeValue : '',
|
||||
'text' => $text ? str_replace('dms.php', APP_ROOT . 'cms/dms.php', $text->nodeValue) : '',
|
||||
'isPublished' => (bool)$content->sichtbar
|
||||
];
|
||||
}
|
||||
|
||||
$this->terminateWithSuccess([
|
||||
'newsId' => (int)$news->news_id,
|
||||
'visibleFrom' => $news->datum,
|
||||
'visibleTo' => $news->datum_bis,
|
||||
'degreeProgramShortCode' => $news->studiengang_kz,
|
||||
'semester' => $news->semester,
|
||||
'translations' => $translations
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a news entry and all supplied translations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function storeNewsItem()
|
||||
{
|
||||
$this->load->library('form_validation');
|
||||
$postData = $this->input->post(null, true);
|
||||
$this->form_validation->set_data(is_array($postData) ? $postData : []);
|
||||
$this->form_validation->set_rules('visibleFrom', 'Visible from', 'required|is_valid_date');
|
||||
$this->form_validation->set_rules('visibleTo', 'Visible to', 'is_valid_date');
|
||||
$this->form_validation->set_rules(
|
||||
'degreeProgramShortCode',
|
||||
'Degree program',
|
||||
'required|is_natural'
|
||||
);
|
||||
$this->form_validation->set_rules(
|
||||
'semester',
|
||||
'Semester',
|
||||
'is_natural_no_zero|less_than_equal_to[8]'
|
||||
);
|
||||
|
||||
$errors = $this->form_validation->run() === false
|
||||
? $this->form_validation->error_array()
|
||||
: [];
|
||||
$visibleFrom = $this->input->post('visibleFrom', true);
|
||||
$visibleTo = $this->input->post('visibleTo', true);
|
||||
$translations = $this->input->post('translations', true);
|
||||
|
||||
if (
|
||||
is_string($visibleFrom)
|
||||
&& is_string($visibleTo)
|
||||
&& $visibleTo !== ''
|
||||
&& is_valid_date($visibleFrom)
|
||||
&& is_valid_date($visibleTo)
|
||||
&& new DateTime($visibleTo) < new DateTime($visibleFrom)
|
||||
)
|
||||
{
|
||||
$errors['visibleTo'] = 'Visible to must not be before Visible from';
|
||||
}
|
||||
|
||||
if (!is_array($translations) || count($translations) === 0)
|
||||
{
|
||||
$errors['translations'] = 'At least one translation is required';
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach ($translations as $index => $translation)
|
||||
{
|
||||
if (!is_array($translation))
|
||||
{
|
||||
$errors['translations.' . $index] = 'Each translation must be an object';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (count($errors) > 0)
|
||||
{
|
||||
$this->terminateWithValidationErrors($errors);
|
||||
}
|
||||
|
||||
|
||||
$this->_ensureUserIsEntitledForDegreeProgram($this->input->post('degreeProgramShortCode', true));
|
||||
|
||||
$degreeProgramShortCode = $this->input->post('degreeProgramShortCode', true);
|
||||
$semester = $this->input->post('semester', true);
|
||||
$semester = $semester === '' ? null : $semester;
|
||||
$visibleTo = $visibleTo === '' ? null : $visibleTo;
|
||||
|
||||
$studiengang = $this->_getStudiengang($degreeProgramShortCode);
|
||||
|
||||
$data = [
|
||||
'studiengang_kz' => $degreeProgramShortCode,
|
||||
'semester' => $semester,
|
||||
'datum' => $visibleFrom,
|
||||
'datum_bis' => $visibleTo,
|
||||
'translations' => []
|
||||
];
|
||||
|
||||
foreach ($translations as $index => $translation)
|
||||
{
|
||||
$data['translations'][$index] = [
|
||||
'sprache' => $translation['language'] ?? '',
|
||||
'verfasser' => $translation['author'] ?? '',
|
||||
'betreff' => $translation['title'] ?? '',
|
||||
'text' => $translation['text'] ?? '',
|
||||
'sichtbar' => isset($translation['isPublished']) ? (bool)$translation['isPublished'] : false
|
||||
];
|
||||
}
|
||||
|
||||
$this->_validateLanguages($data['translations']);
|
||||
|
||||
foreach ($data['translations'] as $index => $translation)
|
||||
{
|
||||
$data['translations'][$index]['content'] = $this->_buildNewsXml($translation);
|
||||
}
|
||||
|
||||
$uid = getAuthUID();
|
||||
$now = date('Y-m-d H:i:s');
|
||||
|
||||
if ($this->db->trans_begin() === false)
|
||||
{
|
||||
$this->terminateWithError($this->db->error(), self::ERROR_TYPE_DB);
|
||||
}
|
||||
|
||||
$contentResult = $this->ContentModel->insert([
|
||||
'template_kurzbz' => 'news',
|
||||
'oe_kurzbz' => $studiengang->oe_kurzbz,
|
||||
'aktiv' => true,
|
||||
'menu_open' => false,
|
||||
'insertamum' => $now,
|
||||
'insertvon' => $uid
|
||||
]);
|
||||
$contentId = (int)$this->_getInsertedIdOrRollback($contentResult);
|
||||
|
||||
$newsResult = $this->NewsModel->insert([
|
||||
'uid' => $uid,
|
||||
'studiengang_kz' => $data['studiengang_kz'],
|
||||
'semester' => $data['semester'],
|
||||
'datum' => $data['datum'],
|
||||
'datum_bis' => $data['datum_bis'],
|
||||
'content_id' => $contentId,
|
||||
'insertamum' => $now,
|
||||
'insertvon' => $uid,
|
||||
'updateamum' => $now,
|
||||
'updatevon' => $uid
|
||||
]);
|
||||
$newsId = (int)$this->_getInsertedIdOrRollback($newsResult);
|
||||
|
||||
foreach ($data['translations'] as $translation)
|
||||
{
|
||||
$translation['content'] = $this->formatContentURLsToRelative($translation['content']);
|
||||
|
||||
$translationResult = $this->ContentspracheModel->insert([
|
||||
'sprache' => $translation['sprache'],
|
||||
'content_id' => $contentId,
|
||||
'version' => 1,
|
||||
'sichtbar' => $translation['sichtbar'],
|
||||
'content' => $translation['content'],
|
||||
'titel' => $translation['betreff'],
|
||||
'insertamum' => $now,
|
||||
'insertvon' => $uid,
|
||||
'updateamum' => $now,
|
||||
'updatevon' => $uid
|
||||
]);
|
||||
|
||||
$this->_getInsertedIdOrRollback($translationResult);
|
||||
}
|
||||
|
||||
$newsItemResult = $this->NewsModel->load($newsId);
|
||||
$newsItem = $this->getDataOrTerminateWithError($newsItemResult);
|
||||
$newsItem = $newsItem[0];
|
||||
|
||||
$this->_sendNewsItemTranslationRequiredMail(
|
||||
$newsItem
|
||||
);
|
||||
|
||||
if ($this->db->trans_status() === false)
|
||||
{
|
||||
$error = $this->db->error();
|
||||
$this->db->trans_rollback();
|
||||
$this->terminateWithError($error, self::ERROR_TYPE_DB);
|
||||
}
|
||||
|
||||
if ($this->db->trans_commit() === false)
|
||||
{
|
||||
$error = $this->db->error();
|
||||
$this->db->trans_rollback();
|
||||
$this->terminateWithError($error, self::ERROR_TYPE_DB);
|
||||
}
|
||||
|
||||
$this->terminateWithSuccess($newsId);
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates a news entry and its supplied translations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function updateNewsItem($newsId)
|
||||
{
|
||||
if (!is_numeric($newsId) || (int)$newsId < 1)
|
||||
{
|
||||
$this->terminateWithValidationErrors([
|
||||
'newsId' => 'A valid news ID is required'
|
||||
]);
|
||||
}
|
||||
|
||||
$newsId = (int)$newsId;
|
||||
$existingNewsResult = $this->NewsModel->load($newsId);
|
||||
|
||||
if (isError($existingNewsResult))
|
||||
{
|
||||
$this->terminateWithError(getError($existingNewsResult), self::ERROR_TYPE_DB);
|
||||
}
|
||||
|
||||
if (!hasData($existingNewsResult))
|
||||
{
|
||||
$this->terminateWithValidationErrors([
|
||||
'newsId' => 'The requested news entry does not exist'
|
||||
]);
|
||||
}
|
||||
|
||||
$existingNews = current(getData($existingNewsResult));
|
||||
|
||||
$this->_ensureUserIsEntitledForDegreeProgram($existingNews->studiengang_kz);
|
||||
|
||||
$this->load->library('form_validation');
|
||||
$postData = $this->input->post(null, true);
|
||||
$this->form_validation->set_data(is_array($postData) ? $postData : []);
|
||||
$this->form_validation->set_rules('visibleFrom', 'Visible from', 'required|is_valid_date');
|
||||
$this->form_validation->set_rules('visibleTo', 'Visible to', 'is_valid_date');
|
||||
$this->form_validation->set_rules(
|
||||
'degreeProgramShortCode',
|
||||
'Degree program',
|
||||
'required|is_natural'
|
||||
);
|
||||
$this->form_validation->set_rules(
|
||||
'semester',
|
||||
'Semester',
|
||||
'is_natural_no_zero|less_than_equal_to[8]'
|
||||
);
|
||||
|
||||
$errors = $this->form_validation->run() === false
|
||||
? $this->form_validation->error_array()
|
||||
: [];
|
||||
$visibleFrom = $this->input->post('visibleFrom', true);
|
||||
$visibleTo = $this->input->post('visibleTo', true);
|
||||
$translations = $this->input->post('translations', true);
|
||||
|
||||
if (
|
||||
is_string($visibleFrom)
|
||||
&& is_string($visibleTo)
|
||||
&& $visibleTo !== ''
|
||||
&& is_valid_date($visibleFrom)
|
||||
&& is_valid_date($visibleTo)
|
||||
&& new DateTime($visibleTo) < new DateTime($visibleFrom)
|
||||
)
|
||||
{
|
||||
$errors['visibleTo'] = 'Visible to must not be before Visible from';
|
||||
}
|
||||
|
||||
if (!is_array($translations) || count($translations) === 0)
|
||||
{
|
||||
$errors['translations'] = 'At least one translation is required';
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach ($translations as $index => $translation)
|
||||
{
|
||||
if (!is_array($translation))
|
||||
{
|
||||
$errors['translations.' . $index] = 'Each translation must be an object';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (count($errors) > 0)
|
||||
{
|
||||
$this->terminateWithValidationErrors($errors);
|
||||
}
|
||||
|
||||
$degreeProgramShortCode = $this->input->post('degreeProgramShortCode', true);
|
||||
$semester = $this->input->post('semester', true);
|
||||
$semester = $semester === '' ? null : $semester;
|
||||
$visibleTo = $visibleTo === '' ? null : $visibleTo;
|
||||
|
||||
$studiengang = $this->_getStudiengang($degreeProgramShortCode);
|
||||
|
||||
$data = [
|
||||
'studiengang_kz' => $degreeProgramShortCode,
|
||||
'semester' => $semester,
|
||||
'datum' => $visibleFrom,
|
||||
'datum_bis' => $visibleTo,
|
||||
'translations' => []
|
||||
];
|
||||
|
||||
foreach ($translations as $index => $translation)
|
||||
{
|
||||
$data['translations'][$index] = [
|
||||
'sprache' => $translation['language'] ?? '',
|
||||
'verfasser' => $translation['author'] ?? '',
|
||||
'betreff' => $translation['title'] ?? '',
|
||||
'text' => $translation['text'] ?? '',
|
||||
'sichtbar' => isset($translation['isPublished']) ? (bool)$translation['isPublished'] : false
|
||||
];
|
||||
}
|
||||
|
||||
$this->_validateLanguages($data['translations']);
|
||||
|
||||
foreach ($data['translations'] as $index => $translation)
|
||||
{
|
||||
$data['translations'][$index]['content'] = $this->_buildNewsXml($translation);
|
||||
}
|
||||
|
||||
$uid = getAuthUID();
|
||||
$now = date('Y-m-d H:i:s');
|
||||
|
||||
if ($this->db->trans_begin() === false)
|
||||
{
|
||||
$this->terminateWithError($this->db->error(), self::ERROR_TYPE_DB);
|
||||
}
|
||||
|
||||
$contentResult = $this->ContentModel->update($existingNews->content_id, [
|
||||
'oe_kurzbz' => $studiengang->oe_kurzbz,
|
||||
'updateamum' => $now,
|
||||
'updatevon' => $uid
|
||||
]);
|
||||
|
||||
if (isError($contentResult))
|
||||
{
|
||||
$this->db->trans_rollback();
|
||||
$this->terminateWithError(getError($contentResult), self::ERROR_TYPE_DB);
|
||||
}
|
||||
|
||||
$newsResult = $this->NewsModel->update($newsId, [
|
||||
'studiengang_kz' => $data['studiengang_kz'],
|
||||
'semester' => $data['semester'],
|
||||
'datum' => $data['datum'],
|
||||
'datum_bis' => $data['datum_bis'],
|
||||
'updateamum' => $now,
|
||||
'updatevon' => $uid
|
||||
]);
|
||||
|
||||
if (isError($newsResult))
|
||||
{
|
||||
$this->db->trans_rollback();
|
||||
$this->terminateWithError(getError($newsResult), self::ERROR_TYPE_DB);
|
||||
}
|
||||
|
||||
$existingTranslationsResult = $this->ContentspracheModel->loadWhere([
|
||||
'content_id' => $existingNews->content_id
|
||||
]);
|
||||
|
||||
if (isError($existingTranslationsResult))
|
||||
{
|
||||
$this->db->trans_rollback();
|
||||
$this->terminateWithError(getError($existingTranslationsResult), self::ERROR_TYPE_DB);
|
||||
}
|
||||
|
||||
$existingTranslations = [];
|
||||
|
||||
foreach ((array)getData($existingTranslationsResult) as $existingTranslation)
|
||||
{
|
||||
$language = $existingTranslation->sprache;
|
||||
|
||||
if (
|
||||
!isset($existingTranslations[$language])
|
||||
|| (int)$existingTranslation->version > (int)$existingTranslations[$language]->version
|
||||
)
|
||||
{
|
||||
$existingTranslations[$language] = $existingTranslation;
|
||||
}
|
||||
}
|
||||
|
||||
$submittedLanguages = array_column($data['translations'], 'sprache');
|
||||
$this->db->where('content_id', $existingNews->content_id);
|
||||
$this->db->where_not_in('sprache', $submittedLanguages);
|
||||
|
||||
if ($this->db->delete('campus.tbl_contentsprache') === false)
|
||||
{
|
||||
$error = $this->db->error();
|
||||
$this->db->trans_rollback();
|
||||
$this->terminateWithError($error, self::ERROR_TYPE_DB);
|
||||
}
|
||||
|
||||
foreach ($data['translations'] as $translation)
|
||||
{
|
||||
$translation['content'] = $this->formatContentURLsToRelative($translation['content']);
|
||||
$translationData = [
|
||||
'sichtbar' => $translation['sichtbar'],
|
||||
'content' => $translation['content'],
|
||||
'titel' => $translation['betreff'],
|
||||
'updateamum' => $now,
|
||||
'updatevon' => $uid
|
||||
];
|
||||
|
||||
$existingTranslation = $existingTranslations[$translation['sprache']] ?? null;
|
||||
|
||||
if ($existingTranslation)
|
||||
{
|
||||
$translationResult = $this->ContentspracheModel->update(
|
||||
$existingTranslation->contentsprache_id,
|
||||
$translationData
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
$translationResult = $this->ContentspracheModel->insert([
|
||||
'sprache' => $translation['sprache'],
|
||||
'content_id' => $existingNews->content_id,
|
||||
'version' => 1,
|
||||
'insertamum' => $now,
|
||||
'insertvon' => $uid
|
||||
] + $translationData);
|
||||
}
|
||||
|
||||
$this->_getInsertedIdOrRollback($translationResult);
|
||||
}
|
||||
|
||||
if ($this->db->trans_status() === false)
|
||||
{
|
||||
$error = $this->db->error();
|
||||
$this->db->trans_rollback();
|
||||
$this->terminateWithError($error, self::ERROR_TYPE_DB);
|
||||
}
|
||||
|
||||
if ($this->db->trans_commit() === false)
|
||||
{
|
||||
$error = $this->db->error();
|
||||
$this->db->trans_rollback();
|
||||
$this->terminateWithError($error, self::ERROR_TYPE_DB);
|
||||
}
|
||||
|
||||
$this->terminateWithSuccess($newsId);
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes one news entry and its linked content.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function deleteNewsItem($newsId)
|
||||
{
|
||||
if (!is_numeric($newsId) || (int)$newsId < 1)
|
||||
{
|
||||
$this->terminateWithValidationErrors([
|
||||
'newsId' => 'A valid news ID is required'
|
||||
]);
|
||||
}
|
||||
|
||||
$newsId = (int)$newsId;
|
||||
$newsResult = $this->NewsModel->load($newsId);
|
||||
|
||||
if (isError($newsResult))
|
||||
{
|
||||
$this->terminateWithError(getError($newsResult), self::ERROR_TYPE_DB);
|
||||
}
|
||||
|
||||
if (!hasData($newsResult))
|
||||
{
|
||||
$this->terminateWithValidationErrors([
|
||||
'newsId' => 'The requested news entry does not exist'
|
||||
]);
|
||||
}
|
||||
|
||||
$news = current(getData($newsResult));
|
||||
|
||||
|
||||
$this->_ensureUserIsEntitledForDegreeProgram($news->studiengang_kz);
|
||||
|
||||
if ($this->db->trans_begin() === false)
|
||||
{
|
||||
$this->terminateWithError($this->db->error(), self::ERROR_TYPE_DB);
|
||||
}
|
||||
|
||||
$newsDeleteResult = $this->NewsModel->delete($newsId);
|
||||
|
||||
if (isError($newsDeleteResult))
|
||||
{
|
||||
$this->db->trans_rollback();
|
||||
$this->terminateWithError(getError($newsDeleteResult), self::ERROR_TYPE_DB);
|
||||
}
|
||||
|
||||
$this->db->where('content_id', $news->content_id);
|
||||
|
||||
if ($this->db->delete('campus.tbl_contentsprache') === false)
|
||||
{
|
||||
$error = $this->db->error();
|
||||
$this->db->trans_rollback();
|
||||
$this->terminateWithError($error, self::ERROR_TYPE_DB);
|
||||
}
|
||||
|
||||
$contentDeleteResult = $this->ContentModel->delete($news->content_id);
|
||||
|
||||
if (isError($contentDeleteResult))
|
||||
{
|
||||
$this->db->trans_rollback();
|
||||
$this->terminateWithError(getError($contentDeleteResult), self::ERROR_TYPE_DB);
|
||||
}
|
||||
|
||||
if ($this->db->trans_status() === false)
|
||||
{
|
||||
$error = $this->db->error();
|
||||
$this->db->trans_rollback();
|
||||
$this->terminateWithError($error, self::ERROR_TYPE_DB);
|
||||
}
|
||||
|
||||
if ($this->db->trans_commit() === false)
|
||||
{
|
||||
$error = $this->db->error();
|
||||
$this->db->trans_rollback();
|
||||
$this->terminateWithError($error, self::ERROR_TYPE_DB);
|
||||
}
|
||||
|
||||
$this->terminateWithSuccess($newsId);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Private methods
|
||||
|
||||
/**
|
||||
* Loads the requested Studiengang or reports a validation error.
|
||||
*
|
||||
* @param integer $studiengangKz
|
||||
* @return stdClass
|
||||
*/
|
||||
private function _getStudiengang($studiengangKz)
|
||||
{
|
||||
$result = $this->StudiengangModel->load($studiengangKz);
|
||||
|
||||
if (isError($result))
|
||||
{
|
||||
$this->terminateWithError(getError($result), self::ERROR_TYPE_DB);
|
||||
}
|
||||
|
||||
if (!hasData($result))
|
||||
{
|
||||
$this->terminateWithValidationErrors([
|
||||
'studiengang_kz' => 'The requested Studiengang does not exist'
|
||||
]);
|
||||
}
|
||||
|
||||
$studiengaenge = getData($result);
|
||||
|
||||
return current($studiengaenge);
|
||||
}
|
||||
|
||||
/**
|
||||
* Ensures that all supplied languages exist in tbl_sprache.
|
||||
*
|
||||
* @param array $translations
|
||||
* @return void
|
||||
*/
|
||||
private function _validateLanguages($translations)
|
||||
{
|
||||
$languages = [];
|
||||
|
||||
foreach ($translations as $translation)
|
||||
{
|
||||
$languages[] = $translation['sprache'];
|
||||
}
|
||||
|
||||
$result = $this->SpracheModel->loadMultiple($languages);
|
||||
|
||||
if (isError($result))
|
||||
{
|
||||
$this->terminateWithError(getError($result), self::ERROR_TYPE_DB);
|
||||
}
|
||||
|
||||
$existingLanguages = [];
|
||||
|
||||
foreach ((array)getData($result) as $language)
|
||||
{
|
||||
$existingLanguages[$language->sprache] = true;
|
||||
}
|
||||
|
||||
$errors = [];
|
||||
|
||||
foreach ($translations as $index => $translation)
|
||||
{
|
||||
if (!isset($existingLanguages[$translation['sprache']]))
|
||||
{
|
||||
$errors['translations.' . $index . '.sprache'] = 'The requested language does not exist';
|
||||
}
|
||||
}
|
||||
|
||||
if (count($errors) > 0)
|
||||
{
|
||||
$this->terminateWithValidationErrors($errors);
|
||||
}
|
||||
}
|
||||
|
||||
private function _ensureUserIsEntitledForDegreeProgram($degreeProgramShortCode)
|
||||
{
|
||||
$entitledDegreePrograms = $this->permissionlib->getSTG_isEntitledFor("basis/news:w");
|
||||
if (!is_array($entitledDegreePrograms))
|
||||
{
|
||||
$this->terminateWithError('Failed to retrieve entitled degree programs for the user', self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
|
||||
if (!in_array($degreeProgramShortCode, $entitledDegreePrograms)) {
|
||||
$this->terminateWithError("User is not entitled for the specified degree program");
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Returns an inserted identifier or rolls the transaction back on error.
|
||||
*
|
||||
* @param stdClass $result
|
||||
* @return mixed
|
||||
*/
|
||||
private function _getInsertedIdOrRollback($result)
|
||||
{
|
||||
if (isError($result))
|
||||
{
|
||||
$this->db->trans_rollback();
|
||||
$this->terminateWithError(getError($result), self::ERROR_TYPE_DB);
|
||||
}
|
||||
|
||||
return getData($result);
|
||||
}
|
||||
|
||||
/**
|
||||
* Builds the XML format consumed by existing news readers.
|
||||
*
|
||||
* @param array $translation
|
||||
* @return string
|
||||
*/
|
||||
private function _buildNewsXml($translation)
|
||||
{
|
||||
$document = new DOMDocument('1.0', 'UTF-8');
|
||||
$news = $document->createElement('news');
|
||||
$document->appendChild($news);
|
||||
|
||||
$this->_appendCdataElement($document, $news, 'verfasser', $translation['verfasser']);
|
||||
$this->_appendCdataElement($document, $news, 'betreff', $translation['betreff']);
|
||||
$this->_appendCdataElement($document, $news, 'text', $translation['text']);
|
||||
|
||||
return $document->saveXML($news);
|
||||
}
|
||||
|
||||
/**
|
||||
* Appends a CDATA element and safely preserves CDATA terminators.
|
||||
*
|
||||
* @param DOMDocument $document
|
||||
* @param DOMElement $parent
|
||||
* @param string $name
|
||||
* @param string $value
|
||||
* @return void
|
||||
*/
|
||||
private function _appendCdataElement($document, $parent, $name, $value)
|
||||
{
|
||||
$element = $document->createElement($name);
|
||||
$parts = explode(']]>', $value);
|
||||
$lastIndex = count($parts) - 1;
|
||||
|
||||
foreach ($parts as $index => $part)
|
||||
{
|
||||
if ($index > 0)
|
||||
{
|
||||
$part = '>' . $part;
|
||||
}
|
||||
|
||||
if ($index < $lastIndex)
|
||||
{
|
||||
$part .= ']]';
|
||||
}
|
||||
|
||||
$element->appendChild($document->createCDATASection($part));
|
||||
}
|
||||
|
||||
$parent->appendChild($element);
|
||||
}
|
||||
|
||||
private function _sendNewsItemTranslationRequiredMail($newsItem)
|
||||
{
|
||||
$translatorsResult = $this->BenutzerfunktionModel->getBenutzerFunktionen("translate", $newsItem->studiengang_kz);
|
||||
$translators = $this->getDataOrTerminateWithError($translatorsResult);
|
||||
|
||||
$newsItemContentResult = $this->ContentspracheModel->loadWhere([
|
||||
'content_id' => $newsItem->content_id,
|
||||
'sprache' => 'German'
|
||||
]);
|
||||
$newsItemContentEntry = getData($newsItemContentResult)[0] ?? null;
|
||||
if ($newsItemContentEntry) {
|
||||
$newsItem->sichtbar = $newsItemContentEntry->sichtbar ?? false;
|
||||
$newsItem->content = $newsItemContentEntry->content;
|
||||
}
|
||||
$content = getData(
|
||||
$this->cmslib->createNewsContent(
|
||||
$this->cmslib->createNewsWrapper($newsItem, true),
|
||||
false,
|
||||
""
|
||||
)
|
||||
);
|
||||
|
||||
foreach ($translators as $translator) {
|
||||
sendSanchoMail(
|
||||
"Sancho_Mail_News_Translation_Req",
|
||||
[
|
||||
"newsItemUrl" => APP_ROOT . "cis.php/CisVue/Cms/newsAdministration?newsId=" . $newsItem->news_id,
|
||||
"newsItemAuthor" => $newsItem->verfasser,
|
||||
"newsItemSubject" => $newsItem->betreff,
|
||||
"newsItemContent" => $content
|
||||
],
|
||||
$translator->uid . "@" . DOMAIN,
|
||||
"Übersetzung erforderlich / Translation required"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
private function formatContentURLsToRelative($content)
|
||||
{
|
||||
$content = preg_replace(
|
||||
'#https?://[^"\'>\s]*/(dms\.php(?:\?[^"\'>\s]*)?)#i',
|
||||
'$1',
|
||||
$content
|
||||
);
|
||||
|
||||
$content = preg_replace(
|
||||
'#(?:\.\./)+[^"\'>\s]*/(dms\.php(?:\?[^"\'>\s]*)?)#i',
|
||||
'$1',
|
||||
$content
|
||||
);
|
||||
|
||||
$content = preg_replace(
|
||||
'#/[^"\'>\s]*/(dms\.php(?:\?[^"\'>\s]*)?)#i',
|
||||
'$1',
|
||||
$content
|
||||
);
|
||||
|
||||
return $content;
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -25,7 +25,19 @@ if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
*/
|
||||
class Ort extends FHCAPI_Controller
|
||||
{
|
||||
|
||||
// advanced filters of getRooms: tbl_ort column => filter type, the same list as in Raumsuche.js.
|
||||
// text: contains, case-insensitive; select: equals; range: <column>_min, <column>_max; flag: true; exists: not null
|
||||
const ADVANCED_FILTERS = [
|
||||
'ort_kurzbz' => 'text',
|
||||
'bezeichnung' => 'text',
|
||||
'planbezeichnung' => 'text',
|
||||
'stockwerk' => 'range',
|
||||
'gebteil' => 'select',
|
||||
'm2' => 'range',
|
||||
'lehre' => 'flag',
|
||||
'content_id' => 'exists'
|
||||
];
|
||||
|
||||
/**
|
||||
* Object initialization
|
||||
*/
|
||||
@@ -36,7 +48,10 @@ class Ort extends FHCAPI_Controller
|
||||
'ContentID' => self::PERM_LOGGED,
|
||||
'getOrtKurzbzContent' => self::PERM_LOGGED,
|
||||
'getRooms' => self::PERM_LOGGED,
|
||||
'getTypes' => self::PERM_LOGGED
|
||||
'getTypes' => self::PERM_LOGGED,
|
||||
'getRoomInfo' => self::PERM_LOGGED,
|
||||
'getStandorte' => self::PERM_LOGGED,
|
||||
'getAdvancedFilterOptions' => self::PERM_LOGGED
|
||||
]);
|
||||
|
||||
$this->load->model('ressource/Ort_model', 'OrtModel');
|
||||
@@ -56,6 +71,17 @@ class Ort extends FHCAPI_Controller
|
||||
$this->form_validation->set_rules('datum','Datum','required');
|
||||
$this->form_validation->set_rules('von','Uhrzeit Von','required|regex_match[/^[0-9]{2}:[0-9]{2}$/]');
|
||||
$this->form_validation->set_rules('bis','Uhrzeit Bis','required|regex_match[/^[0-9]{2}:[0-9]{2}$/]');
|
||||
$this->form_validation->set_rules('standort_id','Standort','regex_match[/^([0-9]+|none)$/]');
|
||||
foreach (self::ADVANCED_FILTERS as $column => $type) {
|
||||
if ($type == 'range') {
|
||||
$this->form_validation->set_rules($column.'_min', $column, 'numeric');
|
||||
$this->form_validation->set_rules($column.'_max', $column, 'numeric');
|
||||
} elseif ($type == 'flag' || $type == 'exists') {
|
||||
$this->form_validation->set_rules($column, $column, 'in_list[true]');
|
||||
} else {
|
||||
$this->form_validation->set_rules($column, $column, 'max_length[255]');
|
||||
}
|
||||
}
|
||||
if($this->form_validation->run() == FALSE) {
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
}
|
||||
@@ -65,6 +91,7 @@ class Ort extends FHCAPI_Controller
|
||||
$bis = $this->input->get('bis', TRUE);
|
||||
$typ = $this->input->get('typ', TRUE);
|
||||
$personenanzahl = $this->input->get('personenanzahl', TRUE);
|
||||
$standort_id = $this->input->get('standort_id', TRUE);
|
||||
|
||||
|
||||
$this->load->model('ressource/Mitarbeiter_model', 'MitarbeiterModel');
|
||||
@@ -74,22 +101,36 @@ class Ort extends FHCAPI_Controller
|
||||
$vonStunde = getData($this->StundeModel->getStundeForTime($von))[0]->stunde;
|
||||
$bisStunde = getData($this->StundeModel->getStundeForTime($bis))[0]->stunde;
|
||||
|
||||
$this->load->model('ressource/Ort_model', 'OrtModel');
|
||||
|
||||
$params = array();
|
||||
$qry = "SELECT DISTINCT tbl_ort.*
|
||||
$qry = "SELECT DISTINCT tbl_ort.*, tbl_standort.bezeichnung AS standort
|
||||
FROM public.tbl_ort JOIN public.tbl_ortraumtyp USING(ort_kurzbz)
|
||||
WHERE aktiv AND lehre AND ort_kurzbz NOT LIKE '\\\\_%'";
|
||||
LEFT JOIN public.tbl_standort USING(standort_id)
|
||||
WHERE aktiv AND reservieren";
|
||||
if($typ) {
|
||||
$params[] = $typ;
|
||||
$qry.= "AND raumtyp_kurzbz = ?";
|
||||
$qry.= " AND raumtyp_kurzbz = ?";
|
||||
}
|
||||
|
||||
if($standort_id === 'none') { // rooms without a Standort
|
||||
$qry.= " AND standort_id IS NULL";
|
||||
} elseif($standort_id) {
|
||||
$params[] = $standort_id;
|
||||
$qry.= " AND standort_id = ?";
|
||||
} else {
|
||||
$qry.= " AND standort_id IS NOT NULL";
|
||||
}
|
||||
|
||||
$qry.= $this->advancedFilterSql($params);
|
||||
|
||||
if(!$isMitarbeiter) { // students are only allowed to get a subset defined by config
|
||||
$qry.= ' AND raumtyp_kurzbz IN ?';
|
||||
$params[] = $this->config->item('roomtypes_student');
|
||||
$this->addMeta('config', $this->config->item('roomtypes_student'));
|
||||
}
|
||||
|
||||
$qry.= "AND (max_person>= ? OR max_person is null)";
|
||||
$qry.= " AND (max_person>= ? OR max_person is null)";
|
||||
$params[] = $personenanzahl;
|
||||
|
||||
$qry.=" AND ort_kurzbz NOT IN
|
||||
@@ -127,6 +168,41 @@ class Ort extends FHCAPI_Controller
|
||||
$this->terminateWithSuccess(getData($result));
|
||||
}
|
||||
|
||||
/**
|
||||
* Standorte of the rooms that pass the base filter of getRooms
|
||||
*/
|
||||
public function getStandorte()
|
||||
{
|
||||
$qry = "SELECT DISTINCT standort_id, tbl_standort.bezeichnung
|
||||
FROM public.tbl_ort JOIN public.tbl_standort USING(standort_id)
|
||||
WHERE aktiv AND reservieren
|
||||
ORDER BY tbl_standort.bezeichnung";
|
||||
|
||||
$result = $this->OrtModel->execReadOnlyQuery($qry);
|
||||
|
||||
$this->terminateWithSuccess($this->getDataOrTerminateWithError($result));
|
||||
}
|
||||
|
||||
/**
|
||||
* Values of the select filters: column => distinct values of the rooms that pass the base filter of getRooms
|
||||
*/
|
||||
public function getAdvancedFilterOptions()
|
||||
{
|
||||
$options = [];
|
||||
foreach (self::ADVANCED_FILTERS as $column => $type) {
|
||||
if ($type != 'select')
|
||||
continue;
|
||||
|
||||
$result = $this->OrtModel->execReadOnlyQuery("SELECT DISTINCT ".$column." AS value
|
||||
FROM public.tbl_ort
|
||||
WHERE aktiv AND reservieren AND ".$column." <> ''
|
||||
ORDER BY ".$column);
|
||||
$options[$column] = array_column($this->getDataOrTerminateWithError($result), 'value');
|
||||
}
|
||||
|
||||
$this->terminateWithSuccess($options);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a JSON body via HTTP POST and provides the parameters
|
||||
*/
|
||||
@@ -174,5 +250,60 @@ class Ort extends FHCAPI_Controller
|
||||
|
||||
$this->terminateWithSuccess($content);
|
||||
}
|
||||
|
||||
public function getRoomInfo()
|
||||
{
|
||||
$ortKurzbz = $this->input->get("ortKurzbz");
|
||||
|
||||
$roomResult = $this->OrtModel->getRoomInfo($ortKurzbz);
|
||||
$roomData = $this->getDataOrTerminateWithError($roomResult);
|
||||
$room = count($roomData) ? $roomData[0] : null;
|
||||
|
||||
$this->terminateWithSuccess($room);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Private methods
|
||||
|
||||
/**
|
||||
* SQL conditions of the advanced filters in the GET parameters, adds their values to $params
|
||||
*/
|
||||
private function advancedFilterSql(&$params)
|
||||
{
|
||||
// no xss_clean: the values are bound, and it could change a select value so that it no longer equals the column
|
||||
$sql = '';
|
||||
foreach (self::ADVANCED_FILTERS as $column => $type) {
|
||||
if ($type == 'range') {
|
||||
$min = $this->input->get($column.'_min');
|
||||
$max = $this->input->get($column.'_max');
|
||||
if ($min !== null && $min !== '') {
|
||||
$sql.= " AND tbl_ort.".$column." >= ?::numeric";
|
||||
$params[] = $min;
|
||||
}
|
||||
if ($max !== null && $max !== '') {
|
||||
$sql.= " AND tbl_ort.".$column." <= ?::numeric";
|
||||
$params[] = $max;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
$value = $this->input->get($column);
|
||||
if ($value === null || $value === '')
|
||||
continue;
|
||||
|
||||
if ($type == 'flag') {
|
||||
$sql.= " AND tbl_ort.".$column;
|
||||
} elseif ($type == 'exists') {
|
||||
$sql.= " AND tbl_ort.".$column." IS NOT NULL";
|
||||
} elseif ($type == 'select') {
|
||||
$sql.= " AND tbl_ort.".$column." = ?";
|
||||
$params[] = $value;
|
||||
} else {
|
||||
$sql.= " AND strpos(lower(tbl_ort.".$column."), lower(?)) > 0";
|
||||
$params[] = $value;
|
||||
}
|
||||
}
|
||||
return $sql;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2024 fhcomplete.org
|
||||
* Copyright (C) 2026 fhcomplete.org
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2026 fhcomplete.org
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
if (!defined('BASEPATH'))
|
||||
exit('No direct script access allowed');
|
||||
|
||||
class Permission extends FHCAPI_Controller
|
||||
{
|
||||
|
||||
/**
|
||||
* Object initialization
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'getPermissions' => self::PERM_LOGGED,
|
||||
]);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
/**
|
||||
* retrieves permissions for auth user
|
||||
* @access public
|
||||
*/
|
||||
public function getPermissions()
|
||||
{
|
||||
$permissionsParam = $this->input->post("permissions");
|
||||
if (!$permissionsParam || !is_array($permissionsParam)) {
|
||||
$this->terminateWithError("Invalid parameter!");
|
||||
}
|
||||
|
||||
$permissions = [];
|
||||
foreach ($permissionsParam as $permission) {
|
||||
$permissions[$permission] = $this->permissionlib->isBerechtigt($permission);
|
||||
}
|
||||
|
||||
$this->terminateWithSuccess($permissions);
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------
|
||||
// Private methods
|
||||
|
||||
}
|
||||
|
||||
@@ -136,7 +136,7 @@ class ProfilUpdate extends FHCAPI_Controller
|
||||
$this->uid == $profil_update->uid
|
||||
) {
|
||||
// Get file to be downloaded from DMS
|
||||
$download = $this->dmslib->getOutputFileInfo($dms_id);
|
||||
$download = $this->dmslib->download($dms_id);
|
||||
$download = $this->getDataOrTerminateWithError($download);
|
||||
// Download file
|
||||
$this->outputFile($download);
|
||||
@@ -456,28 +456,24 @@ class ProfilUpdate extends FHCAPI_Controller
|
||||
$_FILES['files']['error'] = $files['error'][$i];
|
||||
$_FILES['files']['size'] = $files['size'][$i];
|
||||
|
||||
// File upload
|
||||
$uploadDataResult = $this->uploadFile('files', array('jpg', 'png', 'pdf'));
|
||||
if (isError($uploadDataResult)) $this->addError(getError($uploadDataResult));
|
||||
if (!hasData($uploadDataResult)) $this->addError('Upload failed');
|
||||
$dms = [
|
||||
"kategorie_kurzbz" => "profil_aenderung",
|
||||
"version" => 0,
|
||||
"name" => $_FILES['files']['name'],
|
||||
"mimetype" => $_FILES['files']['type'],
|
||||
"beschreibung" => $this->uid . " Profil Änderung",
|
||||
"insertvon" => $this->uid,
|
||||
"insertamum" => "NOW()",
|
||||
];
|
||||
|
||||
if (hasData($uploadDataResult))
|
||||
{
|
||||
// Add file to the DMS (DB + file system)
|
||||
$dms_res = $this->dmslib->add(
|
||||
getData($uploadDataResult)['file_name'],
|
||||
getData($uploadDataResult)['file_type'],
|
||||
fopen(getData($uploadDataResult)['full_path'], 'r'),
|
||||
'profil_aenderung', // kategorie_kurzbz
|
||||
null, // dokument_kurzbz
|
||||
null, // beschreibung
|
||||
false, // cis_suche
|
||||
null, // schlagworte
|
||||
getAuthUID() // insertvon
|
||||
);
|
||||
$dms_res = $this->getDataOrTerminateWithError($dms_res);
|
||||
array_push($res, $dms_res);
|
||||
$tmp_res = $this->dmslib->upload($dms, 'files', array("jpg", "png", "pdf"));
|
||||
|
||||
if(isError($tmp_res)){
|
||||
$this->addError(getError($tmp_res));
|
||||
}
|
||||
|
||||
$tmp_res = $this->getDataOrTerminateWithError($tmp_res);
|
||||
array_push($res, $tmp_res);
|
||||
}
|
||||
|
||||
$this->terminateWithSuccess($res);
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2024 fhcomplete.org
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class Reservierung extends FHCAPI_Controller
|
||||
{
|
||||
|
||||
/**
|
||||
* Object initialization
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'getMyReservation' => 'basis/cis:r',
|
||||
'deleteReservation' => 'lehre/reservierung:rw'
|
||||
]);
|
||||
|
||||
$this->load->model('ressource/Reservierung_model', 'ReservierungModel');
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves all reservations from lehre.vw_reservation of the logged in user
|
||||
*/
|
||||
public function getMyReservation()
|
||||
{
|
||||
$result = $this->ReservierungModel->getMyReservation();
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
/**
|
||||
* deletes a reservation by ID
|
||||
*/
|
||||
public function deleteReservation()
|
||||
{
|
||||
$reservierung_id = $this->input->post('reservierung_id');
|
||||
|
||||
|
||||
if ($reservierung_id === NULL || trim((string)$reservierung_id) === '') {
|
||||
$this->terminateWithError($this->p->t('global', 'wrongParameters'), 'general');
|
||||
}
|
||||
|
||||
$result = $this->ReservierungModel->deleteReservation($reservierung_id);
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ class Studgang extends FHCAPI_Controller
|
||||
{
|
||||
parent::__construct([
|
||||
'getStudiengangInfo'=> self::PERM_LOGGED,
|
||||
|
||||
'getDegreePrograms'=> self::PERM_LOGGED,
|
||||
]);
|
||||
|
||||
$this->load->model('organisation/Studiengang_model', 'StudiengangModel');
|
||||
@@ -43,15 +43,46 @@ class Studgang extends FHCAPI_Controller
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
public function getStudiengangInfo(){
|
||||
$isMitarbeiter = $this->MitarbeiterModel->isMitarbeiter(getAuthUID());
|
||||
$isMitarbeiter = $this->getDataOrTerminateWithError($isMitarbeiter);
|
||||
if($isMitarbeiter) {
|
||||
$this->terminateWithSuccess(null);
|
||||
public function getDegreePrograms() {
|
||||
$entitledDegreePrograms = $this->permissionlib->getSTG_isEntitledFor("basis/news");
|
||||
if (!$entitledDegreePrograms) {
|
||||
$this->terminateWithError("User is not entitled for any degree program");
|
||||
}
|
||||
|
||||
|
||||
$activeDegreePrograms = $this->StudiengangModel->getDegreePrograms();
|
||||
$activeDegreePrograms= $this->getDataOrTerminateWithError($activeDegreePrograms);
|
||||
|
||||
$activeDegreePrograms = array_values(array_filter($activeDegreePrograms, function($degreeProgram) use ($entitledDegreePrograms) {
|
||||
return in_array($degreeProgram->studiengang_kz, $entitledDegreePrograms);
|
||||
}));
|
||||
|
||||
$this->terminateWithSuccess($activeDegreePrograms);
|
||||
}
|
||||
|
||||
public function getStudiengangInfo(){
|
||||
$studiengang_kz = $this->input->get('studiengang_kz', true);
|
||||
$semester = $this->input->get('semester', true);
|
||||
|
||||
// without a Studiengang the info of the logged in Student is returned
|
||||
if (!is_numeric($studiengang_kz))
|
||||
{
|
||||
$isMitarbeiter = $this->MitarbeiterModel->isMitarbeiter(getAuthUID());
|
||||
$isMitarbeiter = $this->getDataOrTerminateWithError($isMitarbeiter);
|
||||
if($isMitarbeiter) {
|
||||
$this->terminateWithSuccess(null);
|
||||
}
|
||||
|
||||
$studiengang_kz = null;
|
||||
$semester = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
$studiengang_kz = (int)$studiengang_kz;
|
||||
$semester = is_numeric($semester) ? (int)$semester : null;
|
||||
}
|
||||
|
||||
// fetches the Studiengang Information which is used next to the news
|
||||
$studiengangInfo = $this->StudiengangModel->getStudiengangInfoForNews();
|
||||
$studiengangInfo = $this->StudiengangModel->getStudiengangInfoForNews($studiengang_kz, $semester);
|
||||
$studiengangInfo= $this->getDataOrTerminateWithError($studiengangInfo);
|
||||
$this->terminateWithSuccess($studiengangInfo);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2024 fhcomplete.org
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
class Studiensemester extends FHCAPI_Controller
|
||||
{
|
||||
|
||||
private $_ci;
|
||||
|
||||
/**
|
||||
* Object initialization
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'getStudiensemester'=> self::PERM_LOGGED,
|
||||
|
||||
]);
|
||||
|
||||
$this->_ci =& get_instance();
|
||||
|
||||
$this->_ci->load->model('organisation/Studiensemester_model', 'StudiensemesterModel');
|
||||
|
||||
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
/**
|
||||
* GET METHOD
|
||||
* returns List of all studiensemester as well as current one
|
||||
*/
|
||||
public function getStudiensemester()
|
||||
{
|
||||
$this->_ci->StudiensemesterModel->addOrder("start", "DESC");
|
||||
$result = $this->_ci->StudiensemesterModel->load();
|
||||
|
||||
$studiensemester = getData($result);
|
||||
$result = $this->_ci->StudiensemesterModel->getAkt();
|
||||
$aktuell = getData($result);
|
||||
|
||||
$this->terminateWithSuccess(array($studiensemester, $aktuell));
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Private methods
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,145 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2026 fhcomplete.org
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class StudstatusAntraege extends FHCAPI_Controller
|
||||
{
|
||||
|
||||
/**
|
||||
* Object initialization
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'getTodos' => self::PERM_LOGGED
|
||||
]);
|
||||
|
||||
//load models
|
||||
$this->load->model('education/Studierendenantrag_model', 'StudierendenantragModel');
|
||||
$this->load->model('person/Benutzerfunktion_model', 'BenutzerfunktionModel');
|
||||
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
/**
|
||||
* gets all todos of antraegen of the user with stg leitungsfunction
|
||||
* or list of open antraege for user with assistance function
|
||||
* @access public
|
||||
* @return array || []
|
||||
*/
|
||||
public function getTodos()
|
||||
{
|
||||
$uid = getAuthUID();
|
||||
|
||||
//at first get studiengang with leitungsfunktion
|
||||
$result = $this->BenutzerfunktionModel->getSTGLByUID($uid);
|
||||
|
||||
if(hasData($result))
|
||||
{
|
||||
$funktionen = getData($result);
|
||||
|
||||
$studiengaenge = [];
|
||||
|
||||
foreach ($funktionen as $funktion) {
|
||||
$studiengaenge[] = $funktion->studiengang_kz;
|
||||
}
|
||||
|
||||
$dataAntrage = [];
|
||||
|
||||
$result = $this->StudierendenantragModel->getOpenAntraegeForStgl($studiengaenge);
|
||||
|
||||
if (isError($result)) {
|
||||
$this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
$dataAntrage[] = getData($result) ?: [];
|
||||
$statusRole = 1;
|
||||
|
||||
$this->terminateWithSuccess([count($dataAntrage) > 0 ? $dataAntrage[0] : $dataAntrage, $statusRole]);
|
||||
|
||||
}
|
||||
|
||||
//TODO delete after check if needed or not
|
||||
//get studiengaenge of assistance (regarding benutzerfunktion)
|
||||
//$result = $this->BenutzerfunktionModel->getSTGAssByUID($uid);
|
||||
/* if(hasData($result)) {
|
||||
$statusRole = 2;
|
||||
$funktionen = getData($result);
|
||||
|
||||
$studiengaenge = [];
|
||||
|
||||
foreach ($funktionen as $funktion) {
|
||||
$studiengaenge[] = $funktion->studiengang_kz;
|
||||
}
|
||||
|
||||
$ci->addMeta('stgAss', $studiengaenge);
|
||||
$dataAntrage = [];
|
||||
|
||||
foreach ($studiengaenge as $studiengang)
|
||||
{
|
||||
$result = $this->StudierendenantragModel->getOpenAntraegeForAss($studiengang);
|
||||
|
||||
if (isError($result)) {
|
||||
$this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
if(hasData($result)) {
|
||||
$dataAntrage[] = getData($result);
|
||||
$statusRole = 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$statusRole = 0;
|
||||
$dataAntrage = [];
|
||||
//$this->terminateWithSuccess([[], $statusRole]);
|
||||
}*/
|
||||
|
||||
//get studiengaenge of assistance (regarding rights)
|
||||
$stgAss = $this->permissionlib->getSTG_isEntitledFor('student/studierendenantrag');
|
||||
if(!is_array($stgAss))
|
||||
{
|
||||
$statusRole = 0;
|
||||
$this->terminateWithSuccess([[], $statusRole]);
|
||||
}
|
||||
else {
|
||||
$statusRole = 2;
|
||||
$studiengaenge = [];
|
||||
|
||||
foreach ($stgAss as $stg) {
|
||||
$studiengaenge[] = (int) $stg;
|
||||
}
|
||||
|
||||
$dataAntrage = [];
|
||||
$result = $this->StudierendenantragModel->getOpenAntraegeForAss($studiengaenge);
|
||||
|
||||
if (isError($result)) {
|
||||
$this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
if(hasData($result)) {
|
||||
$dataAntrage[] = getData($result);
|
||||
$statusRole = 2;
|
||||
}
|
||||
|
||||
$this->terminateWithSuccess([count($dataAntrage) > 0 ? $dataAntrage[0] : $dataAntrage, $statusRole]);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,367 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class Zeitsperren extends FHCAPI_Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'getZeitsperrenUser' => ['cis/eigene_zeitsperren:r', 'admin:r', 'assistenz:r'],
|
||||
'getTypenZeitsperren' => self::PERM_LOGGED,
|
||||
'getTypenErreichbarkeit' => self::PERM_LOGGED,
|
||||
'getStunden' => self::PERM_LOGGED,
|
||||
'loadZeitsperre' => ['cis/eigene_zeitsperren:r', 'admin:r', 'assistenz:r'],
|
||||
'add' => ['cis/eigene_zeitsperren:rw', 'admin:rw', 'assistenz:rw'],
|
||||
'update' => ['cis/eigene_zeitsperren:rw', 'admin:rw', 'assistenz:rw'],
|
||||
'delete' => ['cis/eigene_zeitsperren:rw', 'admin:rw', 'assistenz:rw'],
|
||||
]);
|
||||
|
||||
// Load Libraries
|
||||
$this->load->library('VariableLib', ['uid' => getAuthUID()]);
|
||||
$this->load->library('form_validation');
|
||||
|
||||
// Load language phrases
|
||||
$this->loadPhrases([
|
||||
'ui',
|
||||
'person',
|
||||
'zeitsperren'
|
||||
]);
|
||||
|
||||
// Load models
|
||||
$this->load->model('ressource/Zeitsperre_model', 'ZeitsperreModel');
|
||||
$this->load->model('ressource/Zeitsperretyp_model', 'ZeitsperretypModel');
|
||||
$this->load->model('ressource/Erreichbarkeit_model', 'ErreichbarkeitModel');
|
||||
$this->load->model('ressource/Stunde_model', 'StundeModel');
|
||||
$this->load->model('ressource/Zeitaufzeichnung_model', 'ZeitaufzeichnungModel');
|
||||
}
|
||||
|
||||
public function getZeitsperrenUser($uid)
|
||||
{
|
||||
//check if $uid is passedUser
|
||||
$loggedInUser = getAuthUID();
|
||||
if($loggedInUser != $uid) {
|
||||
$this->load->library('PermissionLib');
|
||||
$isAdmin = $this->permissionlib->isBerechtigt('admin');
|
||||
if(!$isAdmin) {
|
||||
$this->terminateWithError($this->p->t('ui', 'noAdmin'), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
}
|
||||
|
||||
$result = $this->ZeitsperreModel->getZeitsperrenUser($uid);
|
||||
|
||||
if (isError($result)) {
|
||||
$this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
$this->terminateWithSuccess((getData($result) ?: []));
|
||||
}
|
||||
|
||||
public function getTypenZeitsperren()
|
||||
{
|
||||
$excludedTypes = array('ZVerfueg');
|
||||
$result = $this->ZeitsperretypModel->getTypenZeitsperren($excludedTypes);
|
||||
if (isError($result)) {
|
||||
$this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
$this->terminateWithSuccess((getData($result) ?: []));
|
||||
}
|
||||
|
||||
public function getTypenErreichbarkeit()
|
||||
{
|
||||
$result = $this->ErreichbarkeitModel->load();
|
||||
if (isError($result)) {
|
||||
$this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
$this->terminateWithSuccess((getData($result) ?: []));
|
||||
}
|
||||
|
||||
public function getStunden()
|
||||
{
|
||||
$this->StundeModel->addOrder('stunde', 'ASC');
|
||||
$result = $this->StundeModel->load();
|
||||
if (isError($result)) {
|
||||
$this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
$this->terminateWithSuccess((getData($result) ?: []));
|
||||
}
|
||||
|
||||
public function loadZeitsperre($zeitsperre_id)
|
||||
{
|
||||
$this->ZeitsperreModel->addSelect(
|
||||
'campus.tbl_zeitsperre.*, typ.*,
|
||||
ma.person_id AS ma_person_id, ma.vorname AS ma_vorname, ma.nachname AS ma_nachname,
|
||||
ma.titelpre AS ma_titelpre, ma.titelpost AS ma_titelpost'
|
||||
);
|
||||
$this->ZeitsperreModel->addJoin('campus.tbl_zeitsperretyp typ', 'ON (typ.zeitsperretyp_kurzbz = campus.tbl_zeitsperre.zeitsperretyp_kurzbz)');
|
||||
$this->ZeitsperreModel->addJoin('public.tbl_benutzer ben', 'ON (ben.uid = campus.tbl_zeitsperre.vertretung_uid)', 'LEFT');
|
||||
$this->ZeitsperreModel->addJoin('public.tbl_person ma', 'ON (ma.person_id = ben.person_id)', 'LEFT');
|
||||
$result = $this->ZeitsperreModel->loadWhere(
|
||||
array('zeitsperre_id' => $zeitsperre_id)
|
||||
);
|
||||
|
||||
if (isError($result)) {
|
||||
$this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
$this->terminateWithSuccess((current(getData($result)) ?: []));
|
||||
}
|
||||
|
||||
public function add($mitarbeiter_uid)
|
||||
{
|
||||
$loggedInUser = getAuthUID();
|
||||
|
||||
if($mitarbeiter_uid != $loggedInUser)
|
||||
$this->terminateWithError($this->p->t('ui', 'noPermission'), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
$this->form_validation->set_rules('zeitsperretyp_kurzbz', 'Grund Zeitsperre', 'required', [
|
||||
'required' => $this->p->t('ui', 'error_fieldRequired', ['field' => 'Grund Zeitsperre'])
|
||||
]);
|
||||
|
||||
$this->form_validation->set_rules('vondatum', 'VonDatum', 'required|is_valid_date', [
|
||||
'required' => $this->p->t('ui', 'error_fieldRequired', ['field' => 'VonDatum']),
|
||||
'is_valid_date' => $this->p->t('ui', 'error_notValidDate', ['field' => 'VonDatum'])
|
||||
]);
|
||||
|
||||
$this->form_validation->set_rules('bisdatum', 'BisDatum', 'required|is_valid_date|callback_check_von_bis_datum|callback_check_diff_intval', [
|
||||
'required' => $this->p->t('ui', 'error_fieldRequired', ['field' => 'BisDatum']),
|
||||
'is_valid_date' => $this->p->t('ui', 'error_notValidDate', ['field' => 'BisDatum']),
|
||||
'check_von_bis_datum' => $this->p->t('zeitsperre', 'error_VonDatumGroesserAlsBisDatum'),
|
||||
'check_diff_intval' => $this->p->t('zeitsperre', 'error_zeitraumAuffallendHoch')
|
||||
]);
|
||||
|
||||
if ($this->form_validation->run() == false)
|
||||
{
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
}
|
||||
|
||||
$bezeichnung = $this->input->post('bezeichnung');
|
||||
$vondatum = $this->input->post('vondatum');
|
||||
$vonstunde = $this->input->post('vonstunde');
|
||||
$bisdatum = $this->input->post('bisdatum');
|
||||
$bisstunde = $this->input->post('bisstunde');
|
||||
//$vonIso = $this->input->post('vonISO'); //Timestamp für Stunde
|
||||
//$bisIso = $this->input->post('bisISO'); //Timestamp für Stunde
|
||||
$erreichbarkeit_kurzbz = $this->input->post('erreichbarkeit_kurzbz');
|
||||
$vertretung_uid = $this->input->post('vertretung_uid');
|
||||
$zeitsperretyp_kurzbz = $this->input->post('zeitsperretyp_kurzbz');
|
||||
|
||||
//check if existing zeitsperre
|
||||
$result = $this->ZeitsperreModel->getSperreByDate($mitarbeiter_uid, $vondatum, $vonstunde, true);
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
if(hasData($result))
|
||||
{
|
||||
$this->terminateWithError($this->p->t('zeitsperren', 'error_existingZeitsperre', ['typ'=> current($data)->zeitsperretyp_kurzbz]), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
|
||||
//check if existing zeitaufzeichnung
|
||||
if(in_array($zeitsperretyp_kurzbz, Zeitsperre_model::BLOCKIERENDE_ZEITSPERREN))
|
||||
{
|
||||
$result = $this->ZeitsperreModel->existsZeitaufzeichnung($mitarbeiter_uid, $vondatum, $bisdatum);
|
||||
|
||||
if(hasData($result))
|
||||
$this->terminateWithError($this->p->t('zeitsperren', 'error_existingZeitaufzeichnung'), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
|
||||
$result = $this->ZeitsperreModel->insert(
|
||||
[
|
||||
'mitarbeiter_uid' => $mitarbeiter_uid,
|
||||
'bezeichnung' => $bezeichnung,
|
||||
'vondatum' => $vondatum,
|
||||
'vonstunde' => $vonstunde,
|
||||
'bisdatum' => $bisdatum,
|
||||
'bisstunde' => $bisstunde,
|
||||
'erreichbarkeit_kurzbz' => $erreichbarkeit_kurzbz,
|
||||
'zeitsperretyp_kurzbz' => $zeitsperretyp_kurzbz,
|
||||
'vertretung_uid' => $vertretung_uid,
|
||||
'insertvon' => $loggedInUser,
|
||||
'insertamum' => date('c'),
|
||||
]
|
||||
);
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
public function update($zeitsperre_id)
|
||||
{
|
||||
//check if loggedin User is owner of the zeitsperre
|
||||
$loggedInUser = getAuthUID();
|
||||
$result = $this->ZeitsperreModel->load($zeitsperre_id);
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
$uid = current($data)->mitarbeiter_uid;
|
||||
|
||||
if($uid != $loggedInUser)
|
||||
$this->terminateWithError($this->p->t('ui', 'noPermission'), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
if(!$zeitsperre_id)
|
||||
{
|
||||
return $this->terminateWithError($this->p->t('ui', 'error_missingId', ['id'=> 'Zeitsperre_id']), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
//get current params
|
||||
$array_update = [
|
||||
'bezeichnung',
|
||||
'vondatum',
|
||||
'vonstunde',
|
||||
'bisdatum',
|
||||
'bisstunde',
|
||||
// 'vonISO', //Timestamp für Stunde
|
||||
// 'bisISO', //Timestamp für Stunde
|
||||
'erreichbarkeit_kurzbz',
|
||||
'vertretung_uid',
|
||||
'zeitsperretyp_kurzbz',
|
||||
'mitarbeiter_uid',
|
||||
];
|
||||
$post = $this->input->post();
|
||||
$update = [];
|
||||
|
||||
foreach ($array_update as $prop)
|
||||
{
|
||||
if (array_key_exists($prop, $post))
|
||||
{
|
||||
$update[$prop] = $post[$prop];
|
||||
}
|
||||
}
|
||||
|
||||
// Validation
|
||||
$rulesDefined = false; //necessary, otherwise CI validation will always be triggered, even without rules
|
||||
foreach ($update as $key => $val) {
|
||||
switch ($key) {
|
||||
case 'zeitsperretyp_kurzbz':
|
||||
$this->form_validation->set_rules(
|
||||
$key,
|
||||
'Grund Zeitsperre',
|
||||
'required',
|
||||
['required' => $this->p->t('ui', 'error_fieldRequired', ['field'=>'Grund Zeitsperre'])]
|
||||
);
|
||||
$rulesDefined = true;
|
||||
break;
|
||||
case 'vondatum':
|
||||
$this->form_validation->set_rules(
|
||||
$key,
|
||||
'VonDatum',
|
||||
'required|is_valid_date',
|
||||
[
|
||||
'required' => $this->p->t('ui', 'error_fieldRequired', ['field'=>'VonDatum']),
|
||||
'is_valid_date' => $this->p->t('ui', 'error_notValidDate', ['field'=>'VonDatum'])
|
||||
]
|
||||
);
|
||||
$rulesDefined = true;
|
||||
break;
|
||||
case 'bisdatum':
|
||||
$rules = 'required|is_valid_date';
|
||||
if (array_key_exists('vondatum', $update)) {
|
||||
$rules .= '|callback_check_von_bis_datum|callback_check_diff_intval';
|
||||
}
|
||||
$this->form_validation->set_rules(
|
||||
$key,
|
||||
'BisDatum',
|
||||
$rules,
|
||||
[
|
||||
'required' => $this->p->t('ui', 'error_fieldRequired', ['field'=>'BisDatum']),
|
||||
'is_valid_date' => $this->p->t('ui', 'error_notValidDate', ['field'=>'BisDatum']),
|
||||
'check_von_bis_datum' => $this->p->t('zeitsperre', 'error_VonDatumGroesserAlsBisDatum'),
|
||||
'check_diff_intval' => $this->p->t('zeitsperre', 'error_zeitraumAuffallendHoch')
|
||||
]
|
||||
);
|
||||
$rulesDefined = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ($rulesDefined && $this->form_validation->run() == false) {
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
}
|
||||
|
||||
if(array_key_exists('vondatum', $post) || array_key_exists('bisdatum', $post))
|
||||
{
|
||||
$result = $this->ZeitsperreModel->load($zeitsperre_id);
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
$data = current($data);
|
||||
|
||||
$mitarbeiter_uid = array_key_exists('mitarbeiter_uid', $post) ? $update['mitarbeiter_uid'] : $data->mitarbeiter_uid;
|
||||
$vondatum = array_key_exists('vondatum', $post) ? $update['vondatum'] : $data->vondatum;
|
||||
$bisdatum = array_key_exists('bisdatum', $post) ? $update['bisdatum'] : $data->bisdatum;
|
||||
$vonstunde = array_key_exists('vonstunde', $post) ? $update['vonstunde'] : $data->vonstunde;
|
||||
$zeitsperretyp_kurzbz = array_key_exists('zeitsperretyp_kurzbz', $post) ? $update['zeitsperretyp_kurzbz'] : $data->zeitsperretyp_kurzbz;
|
||||
|
||||
$result = $this->ZeitsperreModel->getSperreByDate($mitarbeiter_uid, $vondatum, $vonstunde, true);
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
if(hasData($result))
|
||||
{
|
||||
$this->terminateWithError($this->p->t('zeitsperren', 'error_existingZeitsperre', ['typ'=> current($data)->zeitsperretyp_kurzbz]), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
|
||||
//check if existing zeitaufzeichnung
|
||||
if(in_array($zeitsperretyp_kurzbz, Zeitsperre_model::BLOCKIERENDE_ZEITSPERREN))
|
||||
{
|
||||
$result = $this->ZeitsperreModel->existsZeitaufzeichnung($mitarbeiter_uid, $vondatum, $bisdatum);
|
||||
|
||||
if(hasData($result))
|
||||
$this->terminateWithError($this->p->t('zeitsperren', 'error_existingZeitaufzeichnung'), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($update)) {
|
||||
$update['updatevon'] = $loggedInUser;
|
||||
$update['updateamum'] = date('c');
|
||||
$result = $this->ZeitsperreModel->update($zeitsperre_id, $update);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
else
|
||||
$this->terminateWithSuccess("no update");
|
||||
}
|
||||
|
||||
public function delete($zeitsperre_id)
|
||||
{
|
||||
|
||||
if (!is_numeric($zeitsperre_id) || (int)$zeitsperre_id <= 0)
|
||||
{
|
||||
$this->terminateWithError($this->p->t('ui', 'error_missingId', ['id' => 'Zeitsperre_id']), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
|
||||
//check if loggedin User is owner of the zeitsperre
|
||||
$loggedInUser = getAuthUID();
|
||||
$result = $this->ZeitsperreModel->load($zeitsperre_id);
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
$uid = current($data)->mitarbeiter_uid;
|
||||
|
||||
if($uid != $loggedInUser)
|
||||
$this->terminateWithError($this->p->t('ui', 'noPermission'), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
$result = $this->ZeitsperreModel->delete(
|
||||
array('zeitsperre_id' => $zeitsperre_id)
|
||||
);
|
||||
|
||||
if (isError($result)) {
|
||||
$this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
$this->terminateWithSuccess((getData($result) ?: []));
|
||||
}
|
||||
|
||||
public function check_von_bis_datum($bisdatum)
|
||||
{
|
||||
$vondatum = $this->input->post('vondatum');
|
||||
|
||||
return $vondatum <= $bisdatum;
|
||||
}
|
||||
|
||||
public function check_diff_intval($bisdatum)
|
||||
{
|
||||
$vondatum = $this->input->post('vondatum');
|
||||
|
||||
// Intervall in days
|
||||
$vonTs = strtotime($vondatum);
|
||||
$bisTs = strtotime($bisdatum);
|
||||
|
||||
$tage = ($bisTs - $vonTs) / 86400;
|
||||
|
||||
// if intervall > 14
|
||||
return $tage <= 14;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,276 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2024 fhcomplete.org
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
if (!defined('BASEPATH'))
|
||||
exit('No direct script access allowed');
|
||||
|
||||
class RoomPlan extends FHCAPI_Controller
|
||||
{
|
||||
|
||||
/**
|
||||
* Object initialization
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'addRoomReservation' => self::PERM_LOGGED,
|
||||
'deleteRoomReservation' => self::PERM_LOGGED,
|
||||
'getRoomCreationInfo' => self::PERM_LOGGED,
|
||||
'getGruppen' => self::PERM_LOGGED,
|
||||
'getLektor' => self::PERM_LOGGED,
|
||||
'getReservableMap' => self::PERM_LOGGED,
|
||||
'getGroupOptions' => self::PERM_LOGGED,
|
||||
]);
|
||||
|
||||
$this->load->library('LogLib');
|
||||
$this->loglib->setConfigs(array(
|
||||
'classIndex' => 5,
|
||||
'functionIndex' => 5,
|
||||
'lineIndex' => 4,
|
||||
'dbLogType' => 'API',
|
||||
'dbExecuteUser' => 'RESTful API'
|
||||
));
|
||||
|
||||
$this->load->library('form_validation');
|
||||
$this->load->library('PermissionLib');
|
||||
$this->load->library('StundenplanLib');
|
||||
|
||||
$this->loadPhrases(['ui']);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
|
||||
|
||||
public function addRoomReservation()
|
||||
{
|
||||
$this->form_validation->set_rules('selectedStart', "Start", "required");
|
||||
$this->form_validation->set_rules('selectedEnd', "End", "required");
|
||||
$this->form_validation->set_rules('title', "Title", "required|max_length[10]");
|
||||
$this->form_validation->set_rules('beschreibung', "Beschreibung", "required|max_length[32]");
|
||||
$this->form_validation->set_rules('ort_kurzbz', "Ort", "required|max_length[16]");
|
||||
$this->form_validation->set_rules('studiengang', 'Studiengang', 'numeric');
|
||||
$this->form_validation->set_rules('semester', 'Semester', 'integer|greater_than_equal_to[0]');
|
||||
$this->form_validation->set_rules('verband', 'Verband', 'trim');
|
||||
$this->form_validation->set_rules('gruppe', 'Gruppe', 'trim');
|
||||
$this->form_validation->set_rules('spezialgruppe', 'Spezialgruppe', 'max_length[32]');
|
||||
$this->form_validation->set_rules('lektoren', 'Lektoren');
|
||||
|
||||
if (!$this->form_validation->run())
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
|
||||
$start = $this->input->post('selectedStart');
|
||||
$end = $this->input->post('selectedEnd');
|
||||
$title = $this->input->post('title');
|
||||
$beschreibung = $this->input->post('beschreibung');
|
||||
$ort_kurzbz = $this->input->post('ort_kurzbz');
|
||||
|
||||
$studiengang_kz = $this->input->post('studiengang');
|
||||
$semester = $this->input->post('semester');
|
||||
$verband = $this->input->post('verband');
|
||||
$gruppe = $this->input->post('gruppe');
|
||||
$spezialgruppe = $this->input->post('spezialgruppe');
|
||||
$lektoren = $this->input->post('lektoren');
|
||||
|
||||
|
||||
$result = $this->stundenplanlib->addReservation($start, $end, $title, $beschreibung, $ort_kurzbz, $lektoren, $studiengang_kz, $semester, $verband, $gruppe, $spezialgruppe);
|
||||
|
||||
if (isError($result))
|
||||
$this->terminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($result);
|
||||
}
|
||||
|
||||
public function deleteRoomReservation()
|
||||
{
|
||||
$reservierung_id = $this->input->post('reservierung_id');
|
||||
|
||||
$result = $this->stundenplanlib->deleteReservation($reservierung_id);
|
||||
|
||||
if (isError($result))
|
||||
$this->terminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($result);
|
||||
}
|
||||
|
||||
public function getRoomCreationInfo()
|
||||
{
|
||||
$return_array = array('berechtigt' => false, 'studiengaenge' => []);
|
||||
if (!$this->permissionlib->isBerechtigt('lehre/reservierung'))
|
||||
$this->terminateWithSuccess($return_array);
|
||||
|
||||
$stg_berechtigungen = $this->permissionlib->getSTG_isEntitledFor('lehre/reservierung');
|
||||
if (isEmptyArray($stg_berechtigungen))
|
||||
$this->terminateWithSuccess($return_array);
|
||||
|
||||
$this->load->model('organisation/Studiengang_model', 'StudiengangModel');
|
||||
$this->StudiengangModel->addSelect('studiengang_kz, UPPER(CONCAT(typ, kurzbz)) as kuerzel, kurzbzlang');
|
||||
$this->StudiengangModel->addOrder('typ, kurzbz');
|
||||
$this->StudiengangModel->db->where_in('studiengang_kz', $stg_berechtigungen);
|
||||
$studiengaenge = $this->StudiengangModel->loadWhere(array('aktiv' => true));
|
||||
|
||||
if (isError($studiengaenge))
|
||||
$this->terminateWithError($studiengaenge);
|
||||
|
||||
$return_array['studiengaenge'] = hasData($studiengaenge) ? getData($studiengaenge) : [];
|
||||
$return_array['berechtigt'] = true;
|
||||
|
||||
$this->terminateWithSuccess($return_array);
|
||||
}
|
||||
|
||||
public function getGruppen()
|
||||
{
|
||||
$query = $this->input->get('query');
|
||||
if (is_null($query))
|
||||
$this->terminateWithError($this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
$stg_berechtigungen = $this->permissionlib->getSTG_isEntitledFor('lehre/reservierung');
|
||||
|
||||
if (isEmptyArray($stg_berechtigungen))
|
||||
$this->terminateWithSuccess([]);
|
||||
|
||||
$this->load->model('organisation/gruppe_model', 'GruppeModel');
|
||||
|
||||
$query_words = explode(' ', urldecode($query));
|
||||
|
||||
$this->GruppeModel->addOrder('gruppe_kurzbz');
|
||||
$this->GruppeModel->db->group_start();
|
||||
foreach ($query_words as $word) {
|
||||
$this->GruppeModel->db->group_start();
|
||||
$this->GruppeModel->db->where('gruppe_kurzbz ILIKE', "%" . $word . "%");
|
||||
$this->GruppeModel->db->or_where('bezeichnung ILIKE', "%" . $word . "%");
|
||||
$this->GruppeModel->db->or_where('beschreibung ILIKE', "%" . $word . "%");
|
||||
$this->GruppeModel->db->or_where('orgform_kurzbz ILIKE', "%" . $word . "%");
|
||||
|
||||
if (is_numeric($word)) {
|
||||
$this->GruppeModel->db->or_where('studiengang_kz', $word);
|
||||
}
|
||||
$this->GruppeModel->db->group_end();
|
||||
}
|
||||
$this->GruppeModel->db->group_end();
|
||||
$this->GruppeModel->db->where_in('studiengang_kz', $stg_berechtigungen);
|
||||
$gruppen = $this->GruppeModel->loadWhere(array('sichtbar' => true, 'lehre' => true));
|
||||
if (isError($gruppen))
|
||||
$this->terminateWithError($gruppen);
|
||||
|
||||
$this->terminateWithSuccess(hasData($gruppen) ? getData($gruppen) : []);
|
||||
}
|
||||
|
||||
public function getLektor()
|
||||
{
|
||||
|
||||
$query = $this->input->get('query');
|
||||
if (is_null($query))
|
||||
$this->terminateWithError($this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
$stg_berechtigungen = $this->permissionlib->getSTG_isEntitledFor('lehre/reservierung');
|
||||
|
||||
if (isEmptyArray($stg_berechtigungen))
|
||||
$this->terminateWithSuccess([]);
|
||||
|
||||
$this->load->model('ressource/Mitarbeiter_model', 'MitarbeiterModel');
|
||||
|
||||
$query_words = explode(' ', urldecode($query));
|
||||
|
||||
$this->MitarbeiterModel->addSelect('uid, person_id, vorname, nachname');
|
||||
$this->MitarbeiterModel->addJoin('public.tbl_benutzer', 'uid = mitarbeiter_uid');
|
||||
$this->MitarbeiterModel->addJoin('public.tbl_person', 'person_id');
|
||||
$this->MitarbeiterModel->db->where('public.tbl_benutzer.aktiv', true);
|
||||
$this->MitarbeiterModel->db->group_start();
|
||||
foreach ($query_words as $word) {
|
||||
$this->MitarbeiterModel->db->group_start();
|
||||
$this->MitarbeiterModel->db->where('tbl_person.vorname ILIKE', "%" . $word . "%");
|
||||
$this->MitarbeiterModel->db->or_where('tbl_person.nachname ILIKE', "%" . $word . "%");
|
||||
$this->MitarbeiterModel->db->or_where('uid ILIKE', "%" . $word . "%");
|
||||
$this->MitarbeiterModel->db->group_end();
|
||||
}
|
||||
$this->MitarbeiterModel->db->group_end();
|
||||
|
||||
$this->MitarbeiterModel->addOrder('nachname');
|
||||
$this->MitarbeiterModel->addOrder('vorname');
|
||||
$mitarbeiter = $this->MitarbeiterModel->load();
|
||||
if (isError($mitarbeiter))
|
||||
$this->terminateWithError($mitarbeiter);
|
||||
|
||||
$this->terminateWithSuccess(hasData($mitarbeiter) ? getData($mitarbeiter) : []);
|
||||
}
|
||||
|
||||
public function getReservableMap($ort_kurzbz = null)
|
||||
{
|
||||
$this->form_validation->set_rules('start_date', "StartDate", "required");
|
||||
$this->form_validation->set_rules('end_date', "EndDate", "required");
|
||||
|
||||
if (!$this->form_validation->run())
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
|
||||
// storing the post parameter in local variables
|
||||
$start_date = $this->input->post('start_date', true);
|
||||
$end_date = $this->input->post('end_date', true);
|
||||
|
||||
$result = $this->stundenplanlib->getReservableMap($ort_kurzbz, $start_date, $end_date);
|
||||
|
||||
$this->terminateWithSuccess(array('reservierbarMap' => hasData($result) ? getData($result) : []));
|
||||
}
|
||||
|
||||
public function getGroupOptions()
|
||||
{
|
||||
$studiengangKz = $this->input->get('studiengangKz');
|
||||
|
||||
$this->load->model('organisation/Lehrverband_model', 'LehrverbandModel');
|
||||
$this->LehrverbandModel->addSelect('semester, verband, gruppe');
|
||||
$this->LehrverbandModel->db->where('aktiv', true);
|
||||
$this->LehrverbandModel->db->where('studiengang_kz', $studiengangKz);
|
||||
$lehrverbandResult = $this->LehrverbandModel->load();
|
||||
|
||||
if (isError($lehrverbandResult))
|
||||
$this->terminateWithError($lehrverbandResult);
|
||||
|
||||
$lehrverbanden = hasData($lehrverbandResult) ? getData($lehrverbandResult) : [];
|
||||
|
||||
$grouppedValues = [];
|
||||
foreach ($lehrverbanden as $lehrverband) {
|
||||
if (isset($grouppedValues[$lehrverband->semester]) && $lehrverband->verband !== ' ') {
|
||||
$grouppedValues[$lehrverband->semester][] = $lehrverband;
|
||||
} else if (!isset($grouppedValues[$lehrverband->semester]) && $lehrverband->verband !== ' ') {
|
||||
$grouppedValues[$lehrverband->semester] = [$lehrverband];
|
||||
} else if (!isset($grouppedValues[$lehrverband->semester])) {
|
||||
$grouppedValues[$lehrverband->semester] = [];
|
||||
}
|
||||
}
|
||||
$grouppedValues = array_map(
|
||||
function ($semester) {
|
||||
$verbandGruppen = [];
|
||||
foreach ($semester as $lehrverband) {
|
||||
if (isset($verbandGruppen[$lehrverband->verband]) && $lehrverband->gruppe !== ' ') {
|
||||
$verbandGruppen[$lehrverband->verband][] = $lehrverband->gruppe;
|
||||
} else if (!isset($verbandGruppen[$lehrverband->verband]) && $lehrverband->gruppe !== ' ') {
|
||||
$verbandGruppen[$lehrverband->verband] = [$lehrverband->gruppe];
|
||||
} else if (!isset($verbandGruppen[$lehrverband->verband])) {
|
||||
$verbandGruppen[$lehrverband->verband] = [];
|
||||
}
|
||||
}
|
||||
return $verbandGruppen;
|
||||
},
|
||||
$grouppedValues
|
||||
);
|
||||
|
||||
$this->terminateWithSuccess($grouppedValues);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,218 @@
|
||||
<?php
|
||||
/**
|
||||
* FH-Complete
|
||||
*
|
||||
* @package FHC-API
|
||||
* @author FHC-Team
|
||||
* @copyright Copyright (c) 2016, fhcomplete.org
|
||||
* @license GPLv3
|
||||
* @link http://fhcomplete.org
|
||||
* @since Version 1.0
|
||||
* @filesource
|
||||
*/
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
if (!defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
use CI3_Events as Events;
|
||||
|
||||
class PaabgabeUebersicht extends FHCAPI_Controller
|
||||
{
|
||||
const DOWNLOAD_PERMISSION = 'lehre/abgabetool:download';
|
||||
const ABGABE_TYPES = ['Bachelor', 'Diplom'];
|
||||
|
||||
/**
|
||||
* PaabgabeUebersicht API constructor.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'viewData' => self::PERM_LOGGED,
|
||||
'getPaAbgaben' => array('lehre/abgabetool:r'),
|
||||
'getStudiengaenge' => array('lehre/abgabetool:r'),
|
||||
'getTermine' => array('lehre/abgabetool:r'),
|
||||
'getPaAbgabetypen' => array('lehre/abgabetool:r'),
|
||||
'downloadZip' => array('lehre/abgabetool:r'),
|
||||
//'downloadProjektarbeit' => array('lehre/abgabetool:r')
|
||||
]);
|
||||
|
||||
$this->load->model('education/Paabgabe_model', 'PaabgabeModel');
|
||||
|
||||
$this->load->library('PermissionLib');
|
||||
|
||||
// Load Phrases
|
||||
$this->loadPhrases([
|
||||
'abgabetool'
|
||||
]);
|
||||
}
|
||||
|
||||
public function viewData()
|
||||
{
|
||||
$viewData = [
|
||||
"uid" => getAuthUID(),
|
||||
// TODO create permission
|
||||
"showEdit" => true,
|
||||
];
|
||||
|
||||
$this->terminateWithSuccess($viewData);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Projektabgaben for search criteria.
|
||||
*/
|
||||
public function getPaAbgaben()
|
||||
{
|
||||
$studiengang_kz = $this->input->get('studiengang_kz');
|
||||
$abgabetyp_kurzbz = $this->input->get('abgabetyp_kurzbz');
|
||||
$abgabedatum = $this->input->get('abgabedatum');
|
||||
$personSearchString = $this->input->get('personSearchString');
|
||||
|
||||
$result = $this->PaabgabeModel->getPaAbgaben(self::ABGABE_TYPES, $studiengang_kz, $abgabetyp_kurzbz, $abgabedatum, $personSearchString);
|
||||
|
||||
if (isError($result)) $this->terminateWithError(getError($result), self::ERROR_TYPE_DB);
|
||||
|
||||
// check wether Abgabe is in visual library
|
||||
if (hasData($result))
|
||||
{
|
||||
Events::trigger('in_visual_library', getData($result));
|
||||
}
|
||||
|
||||
$this->terminateWithSuccess(getData($result) ?: []);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all Studiengänge for which user is entitled for
|
||||
*/
|
||||
public function getStudiengaenge()
|
||||
{
|
||||
$studiengang_kz_arr = $this->permissionlib->getSTG_isEntitledFor(self::DOWNLOAD_PERMISSION);
|
||||
|
||||
if (!$studiengang_kz_arr) $this->terminateWithSuccess([]);
|
||||
|
||||
$this->load->model('organisation/Studiengang_model', 'StudiengangModel');
|
||||
|
||||
$this->StudiengangModel->addSelect('tbl_studiengang.*, UPPER(tbl_studiengang.typ || tbl_studiengang.kurzbz) AS kuerzel', $studiengang_kz_arr);
|
||||
$this->StudiengangModel->db->where_in('studiengang_kz', $studiengang_kz_arr);
|
||||
$this->StudiengangModel->addOrder('typ, kurzbz');
|
||||
$result = $this->StudiengangModel->load();
|
||||
|
||||
if (isError($result)) $this->terminateWithError(getError($result), self::ERROR_TYPE_DB);
|
||||
|
||||
$this->terminateWithSuccess((getData($result) ?: []));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get projekt work due dates, depending on search criteria.
|
||||
*/
|
||||
public function getTermine()
|
||||
{
|
||||
$studiengang_kz = $this->input->get('studiengang_kz');
|
||||
$abgabetyp_kurzbz = $this->input->get('abgabetyp_kurzbz');
|
||||
|
||||
$result = $this->PaabgabeModel->getTermine(self::ABGABE_TYPES, $studiengang_kz, $abgabetyp_kurzbz);
|
||||
|
||||
if (isError($result)) $this->terminateWithError(getError($result), self::ERROR_TYPE_DB);
|
||||
|
||||
$this->terminateWithSuccess((getData($result) ?: []));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all submission types.
|
||||
*/
|
||||
public function getPaAbgabetypen()
|
||||
{
|
||||
// Load model PaabgabetypModel
|
||||
$this->load->model('education/Paabgabetyp_model', 'PaabgabetypModel');
|
||||
|
||||
$this->PaabgabetypModel->addOrder('bezeichnung');
|
||||
$result = $this->PaabgabetypModel->load();
|
||||
|
||||
if (isError($result)) $this->terminateWithError(getError($result), self::ERROR_TYPE_DB);
|
||||
|
||||
$this->terminateWithSuccess((getData($result) ?: []));
|
||||
}
|
||||
|
||||
/**
|
||||
* Download zip files with project works matching submission search criteria.
|
||||
*/
|
||||
public function downloadZip()
|
||||
{
|
||||
$studiengang_kz = $this->input->get('studiengang_kz');
|
||||
$abgabetyp_kurzbz = $this->input->get('abgabetyp_kurzbz');
|
||||
$abgabedatum = $this->input->get('abgabedatum');
|
||||
$personSearchString = $this->input->get('personSearchString');
|
||||
|
||||
if (!isset($studiengang_kz) && !isset($abgabetyp_kurzbz) && !isset($abgabedatum) && !isset($personSearchString))
|
||||
$this->terminateWithFileOutput('text/plain', $this->p->t('abgabetool', 'nichtsAusgewaehlt'));
|
||||
|
||||
$this->load->library('zip');
|
||||
|
||||
$result = $this->PaabgabeModel->getPaAbgaben(self::ABGABE_TYPES, $studiengang_kz, $abgabetyp_kurzbz, $abgabedatum, $personSearchString);
|
||||
|
||||
if (isError($result)) $this->terminateWithFileOutput('text/plain', getError($result));
|
||||
|
||||
$fileExists = false;
|
||||
$studiengang_kuerzel = null;
|
||||
|
||||
if (!hasData($result)) $this->terminateWithFileOutput('text/plain', $this->p->t('abgabetool', 'keineDateienVorhanden'));
|
||||
|
||||
$abgaben = getData($result);
|
||||
|
||||
foreach ($abgaben as $abgabe)
|
||||
{
|
||||
$path = PAABGABE_PATH.$abgabe->paabgabe_id.'_'.$abgabe->uid.'.pdf';
|
||||
if (file_exists($path))
|
||||
{
|
||||
$fileExists = true;
|
||||
$studiengang_kuerzel = $abgabe->studiengang_kuerzel;
|
||||
$this->zip->read_file($path);
|
||||
}
|
||||
}
|
||||
|
||||
if (!$fileExists) $this->terminateWithFileOutput('text/plain', $this->p->t('abgabetool', 'keineDateienVorhanden'));
|
||||
|
||||
$studiengang_kz = $this->input->get('studiengang_kz');
|
||||
$zipFileName = 'Abgabe'.(isset($studiengang_kz) && isset($studiengang_kuerzel) ? '_'.$studiengang_kuerzel : '').'.zip';
|
||||
$this->zip->download($zipFileName);
|
||||
}
|
||||
|
||||
/**
|
||||
* Download Projektarbeit document.
|
||||
*/
|
||||
//~ public function downloadProjektarbeit()
|
||||
//~ {
|
||||
//~ $paabgabe_id = $this->input->get('paabgabe_id');
|
||||
|
||||
//~ if (!is_numeric($paabgabe_id))
|
||||
//~ $this->terminateWithError($this->p->t('ui', 'error_missingId', ['id' => 'Abgabe ID']), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
//~ //$abgabeRes = $this->PaabgabeModel->getEndabgabe($projektarbeit_id);
|
||||
//~ $this->PaabgabeModel->addSelect("paabgabe_id, student_uid, tbl_paabgabe.datum, tbl_paabgabe.abgabedatum, projekttyp_kurzbz, titel, titel_english,
|
||||
//~ paabgabe_id || '_' || student_uid || '.pdf' AS filename");
|
||||
//~ $this->PaabgabeModel->addJoin('lehre.tbl_projektarbeit', 'projektarbeit_id');
|
||||
//~ $abgabeRes = $this->PaabgabeModel->load($paabgabe_id);
|
||||
|
||||
//~ if (isError($abgabeRes))
|
||||
//~ show_error(getError($abgabeRes));
|
||||
|
||||
//~ if (hasData($abgabeRes))
|
||||
//~ {
|
||||
//~ $endabgabe = getData($abgabeRes)[0];
|
||||
//~ $filepath = PAABGABE_PATH.$endabgabe->filename;
|
||||
|
||||
//~ if (file_exists($filepath))
|
||||
//~ {
|
||||
//~ $this->output
|
||||
//~ ->set_status_header(200)
|
||||
//~ ->set_content_type('application/pdf', 'utf-8')
|
||||
//~ ->set_header('Content-Disposition: attachment; filename="'.$endabgabe->filename.'"')
|
||||
//~ ->set_output(file_get_contents($filepath))
|
||||
//~ ->_display();
|
||||
//~ }
|
||||
//~ else
|
||||
//~ {
|
||||
//~ show_error("File does not exist.");
|
||||
//~ }
|
||||
//~ }
|
||||
//~ }
|
||||
}
|
||||
@@ -12,9 +12,9 @@ class Funktionen extends FHCAPI_Controller
|
||||
parent::__construct(array(
|
||||
'getAllFunctions' => ['admin:r', 'assistenz:r'],
|
||||
'getAllUserFunctions' => ['admin:r', 'assistenz:r'],
|
||||
'getOrgHeads' => ['admin:r', 'assistenz:r'],
|
||||
'getOrgetsForCompany' => ['admin:r', 'assistenz:r'],
|
||||
'getAllOrgUnits' => ['admin:r', 'assistenz:r'],
|
||||
'getOrgHeads' => self::PERM_LOGGED,
|
||||
'getOrgetsForCompany' => self::PERM_LOGGED,
|
||||
'getAllOrgUnits' => self::PERM_LOGGED,
|
||||
'loadFunction' => ['admin:r', 'assistenz:r'],
|
||||
'insertFunction' => ['admin:rw', 'assistenz:rw'],
|
||||
'updateFunction' => ['admin:rw', 'assistenz:rw'],
|
||||
|
||||
@@ -0,0 +1,81 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2026 fhcomplete.org
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class Betreuungen extends FHCAPI_Controller
|
||||
{
|
||||
|
||||
/**
|
||||
* Object initialization
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'getBetreuungen' => self::PERM_LOGGED,
|
||||
]);
|
||||
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
public function getBetreuungen()
|
||||
{
|
||||
$semester = $this->input->get("semester");
|
||||
if (!$semester) $this->terminateWithError("Missing parameters!");
|
||||
|
||||
$personId = getAuthPersonId();
|
||||
|
||||
$betreuungenQuery = "SELECT
|
||||
tbl_lehrveranstaltung.bezeichnung,
|
||||
tbl_projektarbeit.titel,
|
||||
(SELECT nachname || ' ' || (CASE WHEN wahlname IS NOT NULL THEN wahlname ELSE vorname END)
|
||||
FROM public.tbl_benutzer
|
||||
JOIN public.tbl_person USING(person_id)
|
||||
WHERE uid=student_uid)
|
||||
as name,
|
||||
(SELECT uid
|
||||
FROM public.tbl_benutzer
|
||||
WHERE uid=student_uid)
|
||||
as uid,
|
||||
tbl_lehrveranstaltung.studiengang_kz,
|
||||
tbl_lehrveranstaltung.semester,
|
||||
tbl_studiengang.kurzbzlang as studiengang,
|
||||
tbl_studiengang.email,
|
||||
tbl_betreuerart.beschreibung AS beutreuerart_beschreibung,
|
||||
tbl_projektbetreuer.stunden
|
||||
FROM
|
||||
lehre.tbl_lehrveranstaltung, lehre.tbl_projektarbeit, lehre.tbl_projektbetreuer, public.tbl_studiengang, lehre.tbl_betreuerart
|
||||
WHERE
|
||||
tbl_lehrveranstaltung.lehrveranstaltung_id=tbl_projektarbeit.lehrveranstaltung_id AND
|
||||
tbl_projektarbeit.studiensemester_kurzbz = '$semester' AND
|
||||
tbl_projektarbeit.projektarbeit_id = tbl_projektbetreuer.projektarbeit_id AND
|
||||
tbl_lehrveranstaltung.studiengang_kz = tbl_studiengang.studiengang_kz AND
|
||||
tbl_projektbetreuer.betreuerart_kurzbz = tbl_betreuerart.betreuerart_kurzbz AND
|
||||
tbl_projektbetreuer.person_id = '$personId'";
|
||||
$this->addMeta("query", $betreuungenQuery);
|
||||
|
||||
$this->load->model('education/Lehrveranstaltung_model', 'LehrveranstaltungModel');
|
||||
$result = $this->LehrveranstaltungModel->execReadOnlyQuery($betreuungenQuery);
|
||||
$result = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($result);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -19,7 +19,8 @@ class Lehreinheit extends FHCAPI_Controller
|
||||
'getLehrfach' => ['admin:r', 'assistenz:r'],
|
||||
'getSprache' => ['admin:r', 'assistenz:r'],
|
||||
'getRaumtyp' => ['admin:r', 'assistenz:r'],
|
||||
'getLehrform' => ['admin:r', 'assistenz:r']
|
||||
'getLehrform' => ['admin:r', 'assistenz:r'],
|
||||
'getLehreinheitenBySemester' => self::PERM_LOGGED,
|
||||
]);
|
||||
|
||||
$this->_ci = &get_instance();
|
||||
@@ -438,6 +439,27 @@ class Lehreinheit extends FHCAPI_Controller
|
||||
$this->terminateWithSuccess($this->p->t('global', 'gespeichert'));
|
||||
}
|
||||
|
||||
public function getLehreinheitenBySemester()
|
||||
{
|
||||
$semester = $this->input->get('semester');
|
||||
$lehreinheiten = $this->LehreinheitModel->getLehrenheitenBySemester(getAuthUID(), $semester);
|
||||
$lehreinheiten = $this->getDataOrTerminateWithError($lehreinheiten);
|
||||
|
||||
foreach ($lehreinheiten as $lehreinheit) {
|
||||
$groups = $this->LehreinheitModel->getGroupsByLehreinheit($lehreinheit->lehreinheit_id);
|
||||
$groups = $this->getDataOrTerminateWithError($groups);
|
||||
$stgKurzbz = $lehreinheit->stg_kurzbz;
|
||||
$lehreinheit->groups = array_map(
|
||||
function ($group) use ($stgKurzbz) {
|
||||
return $group->gruppe_kurzbz ?? $stgKurzbz . "-" . $group->semester . $group->verband . $group->gruppe;
|
||||
},
|
||||
$groups
|
||||
);
|
||||
}
|
||||
|
||||
$this->terminateWithSuccess($lehreinheiten);
|
||||
}
|
||||
|
||||
|
||||
private function checkPermission($lehreinheit_id)
|
||||
{
|
||||
|
||||
@@ -158,27 +158,19 @@ class Unterbrechung extends FHCAPI_Controller
|
||||
if (isset($_FILES['attachment']) && (!isset($_FILES['attachment']['error']) || $_FILES['attachment']['error'] != UPLOAD_ERR_NO_FILE)) {
|
||||
$this->load->library('DmsLib');
|
||||
|
||||
$dms = $this->config->item('unterbrechung_dms');
|
||||
if (!count(array_filter($dms, function ($v) {
|
||||
return $v !== null;
|
||||
})))
|
||||
$dms = ['kategorie_kurzbz' => 'Akte'];
|
||||
$dms['version'] = 0;
|
||||
|
||||
$uploadDataResult = $this->uploadFile('attachment', $this->config->item('unterbrechung_dms_filetypes') ?: array('*'));
|
||||
$allowed_filetypes = $this->config->item('unterbrechung_dms_filetypes') ?: ['*'];
|
||||
$result = $this->dmslib->upload($dms, 'attachment', $allowed_filetypes);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($uploadDataResult);
|
||||
|
||||
// Add file to the DMS (DB + file system)
|
||||
$dms_res = $this->dmslib->add(
|
||||
getData($uploadDataResult)['file_name'],
|
||||
getData($uploadDataResult)['file_type'],
|
||||
fopen(getData($uploadDataResult)['full_path'], 'r'),
|
||||
'studierendenantrag',
|
||||
null, // dokument_kurzbz
|
||||
null, // beschreibung
|
||||
false, // cis_suche
|
||||
null, // schlagworte
|
||||
getAuthUID() // insertvon
|
||||
);
|
||||
|
||||
$dms_data = $this->getDataOrTerminateWithError($dms_res);
|
||||
|
||||
$dms_id = $dms_data->dms_id;
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$dms_id = $data['dms_id'];
|
||||
}
|
||||
|
||||
$result = $this->antraglib->createUnterbrechung($prestudent_id, $studiensemester, getAuthUID(), $grund, $datum_wiedereinstieg, $dms_id);
|
||||
|
||||
@@ -32,8 +32,8 @@ class Akte extends Auth_Controller
|
||||
'download' => ['admin:w', 'assistenz:w'],
|
||||
]);
|
||||
|
||||
// Load libraries
|
||||
$this->load->library('AkteLib');
|
||||
// Load models
|
||||
$this->load->model('crm/Akte_model', 'AkteModel');
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
@@ -49,22 +49,22 @@ class Akte extends Auth_Controller
|
||||
|
||||
if (!is_numeric($akte_id)) $this->terminateWithError('akte Id missing');
|
||||
|
||||
$akteResult = $this->aktelib->getByAkteId($akte_id);
|
||||
$result = $this->AkteModel->load($akte_id);
|
||||
|
||||
if (!hasData($akteResult)) $this->terminateWithError('Akte not found');
|
||||
if (!hasData($result)) $this->terminateWithError('Akte not found');
|
||||
|
||||
$data = getData($akteResult)[0];
|
||||
$data = getData($result)[0];
|
||||
|
||||
if (!isEmptyString($data->inhalt))
|
||||
if (isset($data->inhalt) && $data->inhalt != '')
|
||||
{
|
||||
$fileObj = new stdClass();
|
||||
$fileObj->file_content = base64_decode($data->inhalt);
|
||||
$fileObj->name = $data->filename;
|
||||
$fileObj->mimetype = $data->mimetype;
|
||||
$fileObj->disposition = 'attachment';
|
||||
|
||||
$this->outputFile($fileObj);
|
||||
header('Content-Description: File Transfer');
|
||||
header('Content-Type: '. $data->mimetype);
|
||||
header('Expires: 0');
|
||||
header('Cache-Control: must-revalidate');
|
||||
header('Pragma: public');
|
||||
header('Content-Disposition: attachment; filename="'.$data->titel.'"');
|
||||
echo base64_decode($data->inhalt);
|
||||
die();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -46,9 +46,6 @@ class Archiv extends FHCAPI_Controller
|
||||
$this->load->model('crm/Akte_model', 'AkteModel');
|
||||
$this->load->model('system/Vorlage_model', 'VorlageModel');
|
||||
|
||||
// Load libraries
|
||||
$this->load->library('AkteLib');
|
||||
|
||||
// Load language phrases
|
||||
$this->loadPhrases([
|
||||
'archiv'
|
||||
@@ -60,7 +57,7 @@ class Archiv extends FHCAPI_Controller
|
||||
|
||||
/**
|
||||
* Get archive documents for a person
|
||||
|
||||
|
||||
* @return void
|
||||
*/
|
||||
public function getArchiv()
|
||||
@@ -77,11 +74,7 @@ class Archiv extends FHCAPI_Controller
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
}
|
||||
|
||||
$result = $this->aktelib->getByPersonId(
|
||||
$person_id,
|
||||
null, // dokument_kurzbz
|
||||
true // archiv
|
||||
);
|
||||
$result = $this->AkteModel->getArchiv($person_id);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
@@ -101,6 +94,51 @@ class Archiv extends FHCAPI_Controller
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param
|
||||
* @return object success or error
|
||||
*/
|
||||
public function download()
|
||||
{
|
||||
$akte_id = $this->input->get('akte_id');
|
||||
|
||||
if (!is_numeric($akte_id)) $this->terminateWithError('akte Id missing');
|
||||
|
||||
$result = $this->AkteModel->load($akte_id);
|
||||
|
||||
if (!hasData($result)) $this->terminateWithError('Akte not found');
|
||||
|
||||
$data = getData($result)[0];
|
||||
|
||||
$fileObj = new stdClass();
|
||||
if (isset($data->inhalt) && $data->inhalt != '')
|
||||
{
|
||||
// Define handle to output stream
|
||||
$tmpFilePointer = fopen("php://output", 'w');
|
||||
$meta_data = stream_get_meta_data($tmpFilePointer);
|
||||
$filename = $meta_data["uri"];
|
||||
fwrite($tmpFilePointer, $data->inhalt);
|
||||
|
||||
header('Content-Description: File Transfer');
|
||||
header('Content-Type: '. $data->mimetype);
|
||||
header('Expires: 0');
|
||||
header('Cache-Control: must-revalidate');
|
||||
header('Pragma: public');
|
||||
//header('Content-Length: ' . filesize($fileObj->file));
|
||||
//header("Content-type: $data->mimetype");
|
||||
header('Content-Disposition: attachment; filename="'.$data->titel.'"');
|
||||
readfile($filename);
|
||||
die();
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->load->library('AkteLib');
|
||||
|
||||
$result = $this->aktelib->get($akte_id);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Updating an Akte
|
||||
* @return void
|
||||
@@ -155,7 +193,7 @@ class Archiv extends FHCAPI_Controller
|
||||
$this->addMeta('content', base64_encode($content));
|
||||
}
|
||||
|
||||
|
||||
|
||||
foreach ($allowed as $field)
|
||||
if ($this->input->post($field) !== null)
|
||||
$data[$field] = $this->input->post($field);
|
||||
@@ -210,7 +248,7 @@ class Archiv extends FHCAPI_Controller
|
||||
'akte_id' => $akte_id
|
||||
]));
|
||||
}
|
||||
|
||||
|
||||
$result = $this->AkteModel->delete($akte_id);
|
||||
if (isError($result)) $this->terminateWithError(getError($result));
|
||||
|
||||
|
||||
@@ -27,8 +27,7 @@ class Dokumente extends FHCAPI_Controller
|
||||
// Load Libraries
|
||||
$this->load->library('VariableLib', ['uid' => getAuthUID()]);
|
||||
$this->load->library('form_validation');
|
||||
$this->load->library('AkteLib');
|
||||
$this->load->library('DmsLib');
|
||||
$this->load->library('DmsLib', array('who' => getAuthUID()));
|
||||
|
||||
// Load language phrases
|
||||
$this->loadPhrases([
|
||||
@@ -185,7 +184,7 @@ class Dokumente extends FHCAPI_Controller
|
||||
'titel_intern' => $this->input->post('titel_intern'),
|
||||
'nachgereicht_am' => $nachgereicht_am,
|
||||
'updateamum' => date('c'),
|
||||
'updatevon' => getAuthUID(),
|
||||
'updatevon' => $uid,
|
||||
]
|
||||
);
|
||||
|
||||
@@ -202,6 +201,8 @@ class Dokumente extends FHCAPI_Controller
|
||||
if(!$dokument_kurzbz)
|
||||
$this->terminateWithError($this->p->t('ui', 'errorMissingValue', ['value' => 'Dokument_kurzbz']), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
$uid = getAuthUid();
|
||||
|
||||
//check if more than 1 dokumentkurzbz
|
||||
//if()
|
||||
|
||||
@@ -209,10 +210,10 @@ class Dokumente extends FHCAPI_Controller
|
||||
[
|
||||
'prestudent_id' => $prestudent_id,
|
||||
'dokument_kurzbz' => $dokument_kurzbz,
|
||||
'mitarbeiter_uid' => getAuthUID(),
|
||||
'mitarbeiter_uid' => $uid,
|
||||
'datum' => date('c'),
|
||||
'insertamum' => date('c'),
|
||||
'insertvon' => getAuthUID(),
|
||||
'insertvon' => $uid,
|
||||
]
|
||||
);
|
||||
|
||||
@@ -235,6 +236,7 @@ class Dokumente extends FHCAPI_Controller
|
||||
$nachgereicht = current($dataAkte)->nachgereicht;
|
||||
$inhalt = current($dataAkte)->inhalt;
|
||||
$inhaltVorhanden = $inhalt != '';
|
||||
$uid = getAuthUid();
|
||||
|
||||
$this->db->trans_start();
|
||||
|
||||
@@ -248,15 +250,16 @@ class Dokumente extends FHCAPI_Controller
|
||||
$logdata_dms = "Logdata: " . var_export($logdata_dms, true);
|
||||
|
||||
//delete from dmsLib
|
||||
$this->load->library('DmsLib');
|
||||
$person_id = current($dataAkte)->person_id;
|
||||
$result = $this->aktelib->removeByPersonIdAndDmsId($person_id, $dms_id);
|
||||
$result = $this->dmslib->delete($person_id, $dms_id);
|
||||
$this->getDataOrTerminateWithError($result);
|
||||
|
||||
//LOGGING Dms ID
|
||||
$this->load->model('system/Log_model', 'LogModel');
|
||||
$result = $this->LogModel->insert([
|
||||
'executetime' => date('c'),
|
||||
'mitarbeiter_uid' => getAuthUID(),
|
||||
'mitarbeiter_uid' => $uid,
|
||||
'beschreibung' => "Löschen der DMS_ID ". $dms_id,
|
||||
'sql' => $logdata_dms
|
||||
]);
|
||||
@@ -273,7 +276,7 @@ class Dokumente extends FHCAPI_Controller
|
||||
//Logging Deletion Akte
|
||||
$result = $this->LogModel->insert([
|
||||
'executetime' => date('c'),
|
||||
'mitarbeiter_uid' => getAuthUID(),
|
||||
'mitarbeiter_uid' => $uid,
|
||||
'beschreibung' => "Löschen der Akte ". $akte_id,
|
||||
'sql' => "DELETE FROM public.tbl_akte WHERE akte_id=" .$akte_id. " LogData: ". $logdata_akte
|
||||
]);
|
||||
@@ -292,7 +295,7 @@ class Dokumente extends FHCAPI_Controller
|
||||
|
||||
$result = $this->LogModel->insert([
|
||||
'executetime' => date('c'),
|
||||
'mitarbeiter_uid' => getAuthUID(),
|
||||
'mitarbeiter_uid' => $uid,
|
||||
'beschreibung' => "Löschen der Akte ". $akte_id,
|
||||
'sql' => "DELETE FROM public.tbl_akte WHERE akte_id=" .$akte_id. " LogData: ". $logdata_akte
|
||||
]);
|
||||
@@ -307,6 +310,7 @@ class Dokumente extends FHCAPI_Controller
|
||||
|
||||
public function uploadDokument()
|
||||
{
|
||||
$this->load->library('DmsLib');
|
||||
$prestudent_id = $this->input->post('prestudent_id');
|
||||
$anmerkung_intern = $this->input->post('anmerkung_intern');
|
||||
$titel_intern = $this->input->post('titel_intern');
|
||||
@@ -329,44 +333,34 @@ class Dokumente extends FHCAPI_Controller
|
||||
}
|
||||
|
||||
$this->db->trans_start();
|
||||
$uid = getAuthUID();
|
||||
|
||||
$uploadDataResult = $this->uploadFile('anhang', array('jpg', 'png', 'pdf'));
|
||||
if (isError($uploadDataResult))
|
||||
$dms = array(
|
||||
'kategorie_kurzbz' => 'Akte',
|
||||
'version' => 0,
|
||||
'name' => $_FILES['anhang']['name'],
|
||||
'mimetype' => $_FILES['anhang']['type'],
|
||||
'insertamum' => date('c'),
|
||||
'insertvon' => $uid
|
||||
);
|
||||
|
||||
$result = $this->dmslib->upload($dms, 'anhang', array("jpg", "png", "pdf"));
|
||||
|
||||
if (isError($result))
|
||||
{
|
||||
return $this->terminateWithError(getError($uploadDataResult), self::ERROR_TYPE_GENERAL);
|
||||
return $this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
|
||||
// If data exists
|
||||
if (hasData($uploadDataResult))
|
||||
{
|
||||
// Add file to the DMS (DB + file system)
|
||||
$dms_res = $this->dmslib->add(
|
||||
getData($uploadDataResult)['file_name'],
|
||||
getData($uploadDataResult)['file_type'],
|
||||
fopen(getData($uploadDataResult)['full_path'], 'r'),
|
||||
'Akte', // kategorie_kurzbz
|
||||
null, // dokument_kurzbz
|
||||
null, // beschreibung
|
||||
false, // cis_suche
|
||||
null, // schlagworte
|
||||
getAuthUID() // insertvon
|
||||
);
|
||||
}
|
||||
|
||||
// Error occurred or data not found
|
||||
if (isError($dms_res) || !hasData($dms_res)) $this->terminateWithError(getError($dms_res), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
$dms_id = getData($dms_res)->dms_id;
|
||||
$dms_id = $result->retval['dms_id'];
|
||||
|
||||
$person_id = $this->_getPersonId($prestudent_id);
|
||||
|
||||
$dokumentResult = $this->DokumentModel->load($dokument_kurzbz);
|
||||
$data = $this->getDataOrTerminateWithError($dokumentResult);
|
||||
$result = $this->DokumentModel->load($dokument_kurzbz);
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$bezeichnung = current($data)->bezeichnung;
|
||||
|
||||
// Save entry in akte
|
||||
if ($dms_id)
|
||||
//save entry in akte
|
||||
if($dms_id)
|
||||
{
|
||||
$result = $this->AkteModel->insert([
|
||||
'person_id' => $person_id,
|
||||
@@ -375,7 +369,7 @@ class Dokumente extends FHCAPI_Controller
|
||||
'mimetype' => $_FILES['anhang']['type'],
|
||||
'insertamum' => date('c'),
|
||||
'erstelltam' => date('c'),
|
||||
'insertvon' => getAuthUID(),
|
||||
'insertvon' => $uid,
|
||||
'anmerkung_intern' => $anmerkung_intern,
|
||||
'titel_intern' => $titel_intern,
|
||||
'bezeichnung' => $bezeichnung,
|
||||
@@ -422,26 +416,28 @@ class Dokumente extends FHCAPI_Controller
|
||||
$filecontentbase64 = $data->inhalt;
|
||||
$filename = $data->titel;
|
||||
|
||||
if (intval($data->dms_id) > 0)
|
||||
if(intval($data->dms_id) > 0)
|
||||
{
|
||||
$file = $this->dmslib->getOutputFileInfo($data->dms_id, $filename);
|
||||
$dmsdokres = $this->dmslib->read($data->dms_id);
|
||||
if (!hasData($dmsdokres)) $this->terminateWithError('DMS File not found');
|
||||
$dmsdok = getData($dmsdokres)[0];
|
||||
|
||||
$this->terminateWithFileOutput(getData($file)->mimetype, file_get_contents(getData($file)->file), $filename);
|
||||
$mimetype = $dmsdok->mimetype;
|
||||
$filecontentbase64 = $dmsdok->file_content;
|
||||
$filename = $dmsdok->name;
|
||||
}
|
||||
else
|
||||
{
|
||||
$filecontent = '';
|
||||
|
||||
if (!empty($filecontentbase64)) {
|
||||
$filecontent = base64_decode($filecontentbase64, true);
|
||||
$filecontent = '';
|
||||
|
||||
if ($filecontent === false) {
|
||||
$this->terminateWithError('Base64-Dekodierung failed.');
|
||||
}
|
||||
if (!empty($filecontentbase64)) {
|
||||
$filecontent = base64_decode($filecontentbase64, true);
|
||||
|
||||
if ($filecontent === false) {
|
||||
$this->terminateWithError('Base64-Dekodierung failed.');
|
||||
}
|
||||
|
||||
$this->terminateWithFileOutput($mimetype, $filecontent, $filename);
|
||||
}
|
||||
|
||||
$this->terminateWithFileOutput($mimetype, $filecontent, $filename);
|
||||
}
|
||||
|
||||
private function _getMissingDocuments($studiengang_kz, $prestudent_id)
|
||||
@@ -757,7 +753,10 @@ class Dokumente extends FHCAPI_Controller
|
||||
);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
return hasData($data) ? getData($data)[0]->prestudent_id : null;
|
||||
$student = current($data);
|
||||
|
||||
|
||||
return $student->prestudent_id;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -41,6 +41,9 @@ class Grades extends FHCAPI_Controller
|
||||
|
||||
// Load Libraries
|
||||
$this->load->library('VariableLib', ['uid' => getAuthUID()]);
|
||||
$this->load->library('PruefungsverlaufLib', null, 'VerlaufLib');
|
||||
|
||||
$this->load->config('noten');
|
||||
|
||||
// Load Phrases
|
||||
$this->loadPhrases([
|
||||
@@ -355,23 +358,24 @@ class Grades extends FHCAPI_Controller
|
||||
$data['lehrveranstaltung_id'] = $lehrveranstaltung_id;
|
||||
$data['student_uid'] = $student_uid;
|
||||
$data['studiensemester_kurzbz'] = $studiensemester_kurzbz;
|
||||
|
||||
$this->ZeugnisnoteModel->insert($data);
|
||||
|
||||
if (defined('FAS_PRUEFUNG_BEI_NOTENEINGABE_ANLEGEN')
|
||||
&& FAS_PRUEFUNG_BEI_NOTENEINGABE_ANLEGEN) {
|
||||
$result = $this->addTestsForGrade(
|
||||
$studiensemester_kurzbz,
|
||||
$student_uid,
|
||||
$lehrveranstaltung_id,
|
||||
$teacherGrade->note,
|
||||
$teacherGrade->punkte
|
||||
);
|
||||
$this->getDataOrTerminateWithError($result);
|
||||
}
|
||||
$this->ZeugnisnoteModel->insert($data);
|
||||
}
|
||||
|
||||
// Der erste Antritt wird bereits bei der Übernahme als eigene Prüfung angelegt, damit der
|
||||
// Prüfungsverlauf von Anfang an vollständig ist und das Benotungstool ihn nicht erst beim
|
||||
// Anlegen einer Wiederholung nachtragen muss. Läuft bewusst in BEIDEN Zweigen (auch beim
|
||||
// Überschreiben einer bestehenden Zeugnisnote) und ist idempotent.
|
||||
if ($this->config->item('CIS_GESAMTNOTE_ERSTANTRITT_BEI_UEBERNAHME')) {
|
||||
$result = $this->addErstantrittForGrade(
|
||||
$studiensemester_kurzbz,
|
||||
$student_uid,
|
||||
$lehrveranstaltung_id,
|
||||
$teacherGrade
|
||||
);
|
||||
$this->getDataOrTerminateWithError($result);
|
||||
}
|
||||
|
||||
|
||||
$this->terminateWithSuccess(true);
|
||||
}
|
||||
|
||||
@@ -491,20 +495,32 @@ class Grades extends FHCAPI_Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper function that adds tests for a student
|
||||
* (Entries in lehre.tbl_pruefung)
|
||||
* Legt bei der Notenübernahme den ersten Prüfungsantritt als eigenen Datensatz an
|
||||
* (Eintrag in lehre.tbl_pruefung).
|
||||
*
|
||||
* @param string $studiensemester_kurzbz
|
||||
* @param string $student_uid
|
||||
* @param integer $lehrveranstaltung_id
|
||||
* @param integer $note
|
||||
* @param numeric $punkte
|
||||
* Idempotent: existiert für den Studenten in dieser LV bereits ein Termin, passiert nichts -
|
||||
* die Übernahme darf beliebig oft laufen, ohne den Verlauf zu verfälschen.
|
||||
*
|
||||
* Datiert auf das Freigabedatum der LV-Note: das ist der Zeitpunkt, zu dem die
|
||||
* Leistungsfeststellung verbindlich wurde. Das Benotungsdatum ändert sich bei jeder Korrektur,
|
||||
* der Übernahmezeitpunkt ist reine Verwaltungsarbeit - beide taugen nicht als Termindatum.
|
||||
*
|
||||
* @param string $studiensemester_kurzbz
|
||||
* @param string $student_uid
|
||||
* @param integer $lehrveranstaltung_id
|
||||
* @param stdClass $teacherGrade die übernommene LV-Gesamtnote
|
||||
*
|
||||
* @return stdClass
|
||||
*/
|
||||
protected function addTestsForGrade($studiensemester_kurzbz, $student_uid, $lehrveranstaltung_id, $note, $punkte)
|
||||
protected function addErstantrittForGrade($studiensemester_kurzbz, $student_uid, $lehrveranstaltung_id, $teacherGrade)
|
||||
{
|
||||
$this->load->model('education/Lehrveranstaltung_model', 'LehrveranstaltungModel');
|
||||
$this->load->model('education/LePruefung_model', 'LePruefungModel');
|
||||
|
||||
// bereits ein Termin vorhanden -> der Verlauf beginnt schon, nichts nachzutragen
|
||||
$vorhanden = $this->VerlaufLib->getPruefungen($student_uid, $lehrveranstaltung_id, $studiensemester_kurzbz);
|
||||
if (count($vorhanden) > 0)
|
||||
return success(null);
|
||||
|
||||
// Get Lehreinheit
|
||||
$result = $this->LehrveranstaltungModel->getLeByStudent($student_uid, $studiensemester_kurzbz, $lehrveranstaltung_id);
|
||||
@@ -515,19 +531,24 @@ class Grades extends FHCAPI_Controller
|
||||
return error($this->p->t("stv", "grades_error_lehreinheit_id"));
|
||||
$le = current(getData($result));
|
||||
|
||||
$datum = $teacherGrade->freigabedatum ?: ($teacherGrade->benotungsdatum ?: date('Y-m-d'));
|
||||
$now = date('Y-m-d H:i:s');
|
||||
|
||||
// Prepare
|
||||
$this->load->model('education/LePruefung_model', 'LePruefungModel');
|
||||
$data = [
|
||||
"student_uid" => $student_uid,
|
||||
"lehreinheit_id" => $le->lehreinheit_id,
|
||||
"datum" => date('Y-m-d'),
|
||||
"pruefungstyp_kurzbz" => "Termin1",
|
||||
"note" => $note
|
||||
"mitarbeiter_uid" => $teacherGrade->mitarbeiter_uid,
|
||||
"datum" => $datum,
|
||||
"pruefungstyp_kurzbz" => $this->VerlaufLib->legacyTypFuerAntritt(1),
|
||||
"note" => $teacherGrade->note,
|
||||
"insertamum" => $now,
|
||||
"insertvon" => getAuthUID()
|
||||
];
|
||||
|
||||
if (defined('CIS_GESAMTNOTE_PUNKTE') && CIS_GESAMTNOTE_PUNKTE)
|
||||
$data["punkte"] = $punkte;
|
||||
|
||||
$data["punkte"] = $teacherGrade->punkte;
|
||||
|
||||
// Get Anwesenheit
|
||||
$this->load->model('education/Anwesenheit_model', 'AnwesenheitModel');
|
||||
$result = $this->AnwesenheitModel->loadAnwesenheitStudiensemester($studiensemester_kurzbz, $student_uid, $lehrveranstaltung_id);
|
||||
@@ -535,7 +556,8 @@ class Grades extends FHCAPI_Controller
|
||||
return $result;
|
||||
$anwesenheit = getData($result);
|
||||
|
||||
if ($anwesenheit && (float)current($anwesenheit)->prozent < FAS_ANWESENHEIT_ROT) {
|
||||
if (defined('FAS_PRUEFUNG_BEI_NOTENEINGABE_ANLEGEN') && FAS_PRUEFUNG_BEI_NOTENEINGABE_ANLEGEN
|
||||
&& $anwesenheit && (float)current($anwesenheit)->prozent < FAS_ANWESENHEIT_ROT) {
|
||||
// Get Anwesenheitsbefreiung
|
||||
$this->load->model('person/Benutzerfunktion_model', 'BenutzerfunktionModel');
|
||||
$result = $this->BenutzerfunktionModel->getBenutzerFunktionByUidInStdsem($student_uid, $studiensemester_kurzbz, 'awbefreit');
|
||||
@@ -545,7 +567,10 @@ class Grades extends FHCAPI_Controller
|
||||
|
||||
$anwesenheitsbefreit = hasData($result);
|
||||
|
||||
// Wenn nicht Anwesenheitsbefreit und Anwesenheit unter einem bestimmten Prozentsatz fällt dann wird ein Pruefungsantritt abgezogen
|
||||
// Bei zu geringer Anwesenheit ohne Befreiung wird ein zusätzlicher Termin
|
||||
// 'Nicht beurteilt' vor dem eigentlichen Antritt festgehalten. ACHTUNG: diese Note
|
||||
// zählt nicht mehr als Antritt (NOTEN_OHNE_ANTRITT_BEZEICHNUNGEN) - der frühere
|
||||
// "Antritt abziehen"-Effekt entfällt damit, der Eintrag ist reine Dokumentation.
|
||||
if (!$anwesenheitsbefreit) {
|
||||
$data2 = $data;
|
||||
$data2["note"] = 7;
|
||||
@@ -556,8 +581,6 @@ class Grades extends FHCAPI_Controller
|
||||
|
||||
if (isError($result))
|
||||
return $result;
|
||||
|
||||
$data["pruefungstyp_kurzbz"] = "Termin2";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -574,6 +574,19 @@ class Kontakt extends FHCAPI_Controller
|
||||
$person_id = $this->input->post('person_id');
|
||||
$standort_id = $this->input->post('standort_id');
|
||||
|
||||
//check person_id: allow editing only of persons who are no mitarbeiter
|
||||
if($person_id)
|
||||
{
|
||||
$this->load->model('person/Benutzer_model', 'BenutzerModel');
|
||||
$this->BenutzerModel->addJoin('public.tbl_mitarbeiter ma', 'ON (ma.mitarbeiter_uid = public.tbl_benutzer.uid)');
|
||||
|
||||
$result = $this->BenutzerModel->loadWhere([
|
||||
'person_id' => $person_id
|
||||
]);
|
||||
if(hasData($result))
|
||||
return $this->terminateWithError($this->p->t('ui', 'editingMitarbeiterPVonly'), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
|
||||
$result = $this->KontaktModel->update(
|
||||
[
|
||||
'kontakt_id' => $kontakt_id
|
||||
|
||||
@@ -33,6 +33,11 @@ class Notiz extends Notiz_Controller
|
||||
]);
|
||||
}
|
||||
|
||||
/* public function getUid()
|
||||
{
|
||||
$this->terminateWithSuccess(getAuthUID());
|
||||
}*/
|
||||
|
||||
|
||||
public function getNotizen($id, $type)
|
||||
{
|
||||
@@ -54,6 +59,317 @@ class Notiz extends Notiz_Controller
|
||||
|
||||
}
|
||||
|
||||
/* public function loadNotiz()
|
||||
{
|
||||
$_POST = json_decode(utf8_encode($this->input->raw_input_stream), true);
|
||||
|
||||
$notiz_id = $this->input->post('notiz_id');
|
||||
|
||||
//$this->load->model('person/Notiz_model', 'NotizModel');
|
||||
$this->NotizModel->addJoin('public.tbl_notiz_dokument', 'notiz_id', 'LEFT');
|
||||
$this->NotizModel->addSelect('*');
|
||||
$this->NotizModel->addSelect("TO_CHAR(CASE WHEN public.tbl_notiz.updateamum >= public.tbl_notiz.insertamum
|
||||
THEN public.tbl_notiz.updateamum ELSE public.tbl_notiz.insertamum END::timestamp, 'DD.MM.YYYY HH24:MI:SS') AS lastUpdate");
|
||||
$this->NotizModel->addLimit(1);
|
||||
|
||||
$result = $this->NotizModel->loadWhere(
|
||||
array('notiz_id' => $notiz_id)
|
||||
);
|
||||
if (isError($result))
|
||||
{
|
||||
$this->terminateWithError($result, self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
elseif (!hasData($result))
|
||||
{
|
||||
$this->terminateWithError($this->p->t('ui', 'error_missingId', ['id'=>'Notiz_id']), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->terminateWithSuccess(current(getData($result)));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function updateNotiz()
|
||||
{
|
||||
$this->load->library('form_validation');
|
||||
$this->load->library('DmsLib');
|
||||
|
||||
if (isset($_POST['data']))
|
||||
{
|
||||
$data = json_decode($_POST['data']);
|
||||
unset($_POST['data']);
|
||||
foreach ($data as $k => $v) {
|
||||
$_POST[$k] = $v;
|
||||
}
|
||||
}
|
||||
|
||||
$notiz_id = $this->input->post('notiz_id');
|
||||
|
||||
if(!$notiz_id)
|
||||
{
|
||||
$this->terminateWithError($this->p->t('ui','error_missingId',['id'=>'Notiz_id']), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
|
||||
//Form Validation
|
||||
$this->form_validation->set_rules('titel', 'Titel', 'required', [
|
||||
'required' => $this->p->t('ui', 'error_fieldRequired', ['field' => 'Titel'])
|
||||
]);
|
||||
|
||||
$this->form_validation->set_rules('text', 'Text', 'required', [
|
||||
'required' => $this->p->t('ui', 'error_fieldRequired', ['field' => 'Text'])
|
||||
]);
|
||||
|
||||
if ($this->form_validation->run() == false)
|
||||
{
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
}
|
||||
|
||||
//update Notiz
|
||||
$uid = getAuthUID();
|
||||
$titel = $this->input->post('titel');
|
||||
$text = $this->input->post('text');
|
||||
$verfasser_uid = $this->input->post('verfasser');
|
||||
$bearbeiter_uid = isset($_POST['bearbeiter']) ? $_POST['bearbeiter'] : $uid;
|
||||
$erledigt = $this->input->post('erledigt');
|
||||
$start = $this->input->post('start');
|
||||
$ende = $this->input->post('ende');
|
||||
|
||||
$result = $this->NotizModel->update(
|
||||
[
|
||||
'notiz_id' => $notiz_id
|
||||
],
|
||||
[
|
||||
'titel' => $titel,
|
||||
'updatevon' => $uid,
|
||||
'updateamum' => date('c'),
|
||||
'text' => $text,
|
||||
'verfasser_uid' => $verfasser_uid,
|
||||
'bearbeiter_uid' => $bearbeiter_uid,
|
||||
'start' => $start,
|
||||
'ende' => $ende,
|
||||
'erledigt' => $erledigt
|
||||
]
|
||||
);
|
||||
if (isError($result))
|
||||
{
|
||||
return $this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
|
||||
//update(1) laden aller bereits mit dieser notiz_id verknüpften DMS-Einträge
|
||||
$this->load->model('person/Notizdokument_model', 'NotizdokumentModel');
|
||||
$this->NotizdokumentModel->addJoin('campus.tbl_dms_version', 'dms_id');
|
||||
$dms_uploaded = null;
|
||||
|
||||
$result = $this->NotizdokumentModel->loadWhere(array('notiz_id' => $notiz_id));
|
||||
if (isError($result))
|
||||
{
|
||||
$this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
elseif (!hasData($result))
|
||||
{
|
||||
$dms_id_arr = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
$result = getData($result);
|
||||
foreach($result as $doc) {
|
||||
$dms_id_arr[] = array(
|
||||
'name' => $doc->name,
|
||||
'dms_id' => $doc->dms_id
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($_FILES as $k => $file)
|
||||
{
|
||||
//update(2) alle neuen files (alle außer type application/x.fhc-dms+json) anhängen
|
||||
if($file["type"] == 'application/x.fhc-dms+json')
|
||||
{
|
||||
$dms_uploaded[] = array(
|
||||
'name' => $file["name"]
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
$dms = array(
|
||||
'kategorie_kurzbz' => 'notiz',
|
||||
'version' => 0,
|
||||
'name' => $file["name"],
|
||||
'mimetype' => $file["type"],
|
||||
'insertamum' => date('c'),
|
||||
'insertvon' => $uid
|
||||
);
|
||||
|
||||
//Todo(manu) check if filetypes weiter eingeschränkt werden sollen
|
||||
//Todo(manu)check name files: nicht gleiches file 2mal hochladen
|
||||
$result = $this->dmslib->upload($dms, $k, array('*'));
|
||||
|
||||
if (isError($result))
|
||||
{
|
||||
return $this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
$dms_id = $result->retval['dms_id'];
|
||||
|
||||
$result = $this->NotizdokumentModel->insert(array('notiz_id' => $notiz_id, 'dms_id' => $dms_id));
|
||||
if (isError($result))
|
||||
{
|
||||
return $this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//update(3) check if Dateien gelöscht wurden
|
||||
if(count($dms_uploaded) != count($dms_id_arr))
|
||||
{
|
||||
if (count($dms_uploaded) == 0)
|
||||
{
|
||||
$filesDeleted = $dms_id_arr;
|
||||
}
|
||||
else
|
||||
{
|
||||
$upload_new_names = array_column($dms_uploaded, "name");
|
||||
|
||||
$filesDeleted = array_filter($dms_id_arr, function ($file) use ($upload_new_names) {
|
||||
return !in_array($file["name"], $upload_new_names);
|
||||
});
|
||||
}
|
||||
|
||||
foreach ($filesDeleted as $file)
|
||||
{
|
||||
$result = $this->dmslib->removeAll($file['dms_id']);
|
||||
|
||||
if (isError($result))
|
||||
{
|
||||
return $this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
else
|
||||
$this->outputJson($result);
|
||||
}
|
||||
}
|
||||
return $this->terminateWithSuccess($result);
|
||||
}*/
|
||||
|
||||
|
||||
/* public function deleteNotiz()
|
||||
{
|
||||
$_POST = json_decode(utf8_encode($this->input->raw_input_stream), true);
|
||||
$notiz_id = $this->input->post('notiz_id');
|
||||
$type = $this->input->post('type_id');
|
||||
$id = $this->input->post('id');
|
||||
|
||||
//dms_id auslesen aus notizdokument wenn vorhanden
|
||||
$dms_id_arr = [];
|
||||
$this->load->model('person/Notizdokument_model', 'NotizdokumentModel');
|
||||
|
||||
$result = $this->NotizdokumentModel->loadWhere(array('notiz_id' => $notiz_id));
|
||||
|
||||
if (isError($result))
|
||||
{
|
||||
return $this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
|
||||
if(hasData($result))
|
||||
{
|
||||
$result = getData($result);
|
||||
foreach ($result as $doc) {
|
||||
$dms_id_arr[] = $doc->dms_id;
|
||||
}
|
||||
}
|
||||
|
||||
if($dms_id_arr)
|
||||
{
|
||||
$this->load->library('DmsLib');
|
||||
foreach($dms_id_arr as $dms_id)
|
||||
{
|
||||
$result = $this->dmslib->removeAll($dms_id);
|
||||
|
||||
if (isError($result))
|
||||
{
|
||||
return $this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
|
||||
$this->outputJson($result);
|
||||
}
|
||||
}
|
||||
|
||||
//delete Notizzuordnung
|
||||
if($type == "software_id")
|
||||
{
|
||||
// Loads extension Model
|
||||
$this->load->model('extensions/FHC-Core-Softwarebereitstellung/Softwarenotizzuordnung_model', 'ExtensionnotizzuordnungModel');
|
||||
$result = $this->ExtensionnotizzuordnungModel->delete([
|
||||
'notiz_id' => $notiz_id,
|
||||
'id' => strval($id)
|
||||
],
|
||||
[
|
||||
'type_id' => $type
|
||||
]);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
//notizzuordnungsid!
|
||||
$result = $this->NotizzuordnungModel->delete(['notiz_id' => $notiz_id, $type => $id]);
|
||||
}
|
||||
|
||||
|
||||
$this->load->model('person/Notiz_model', 'NotizModel');
|
||||
//$this->NotizModel->addJoin('public.tbl_notizzuordnung', 'notiz_id');
|
||||
|
||||
//TODO (erweitern um Type_id) für Extensions, damit auch Notizzuordnung gelöscht werden kann
|
||||
|
||||
//Löschen von Notiz
|
||||
$result = $this->NotizModel->delete(
|
||||
array('notiz_id' => $notiz_id)
|
||||
);
|
||||
|
||||
if (isError($result))
|
||||
{
|
||||
return $this->terminateWithError($result, self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
if(!hasData($result))
|
||||
{
|
||||
return $this->terminateWithError($this->p->t('ui','error_missingId', ['id'=> 'Notiz_id']), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
|
||||
return $this->terminateWithSuccess(current(getData($result)));
|
||||
}*/
|
||||
|
||||
/* public function loadDokumente()
|
||||
{
|
||||
$_POST = json_decode(utf8_encode($this->input->raw_input_stream), true);
|
||||
$notiz_id = $this->input->post('notiz_id');
|
||||
|
||||
$this->NotizModel->addSelect('campus.tbl_dms_version.*');
|
||||
|
||||
$this->NotizModel->addJoin('public.tbl_notiz_dokument', 'ON (public.tbl_notiz_dokument.notiz_id = public.tbl_notiz.notiz_id)');
|
||||
$this->NotizModel->addJoin('campus.tbl_dms_version', 'ON (public.tbl_notiz_dokument.dms_id = campus.tbl_dms_version.dms_id)');
|
||||
|
||||
$result = $this->NotizModel->loadWhere(
|
||||
array('public.tbl_notiz.notiz_id' => $notiz_id)
|
||||
);
|
||||
if (isError($result)) {
|
||||
return $this->terminateWithError($result, self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
|
||||
if(!hasData($result))
|
||||
{
|
||||
return $this->terminateWithError($this->p->t('ui','error_missingId', ['id'=> 'Notiz_id']), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
return $this->terminateWithSuccess(getData($result));
|
||||
}*/
|
||||
|
||||
/* public function getMitarbeiter($searchString)
|
||||
{
|
||||
$this->load->model('ressource/Mitarbeiter_model', 'MitarbeiterModel');
|
||||
$result = $this->MitarbeiterModel->searchMitarbeiter($searchString);
|
||||
if (isError($result)) {
|
||||
$this->terminateWithError($result, self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
return $this->terminateWithSuccess($result);
|
||||
}*/
|
||||
|
||||
public function isBerechtigt($id, $typeId)
|
||||
{
|
||||
if(!$this->permissionlib->isBerechtigt('admin', 'suid') && !$this->permissionlib->isBerechtigt('assistenz', 'suid'))
|
||||
@@ -63,6 +379,7 @@ class Notiz extends Notiz_Controller
|
||||
return $this->terminateWithError($result, self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
return success("berechtigt in überschreibender Funktion");
|
||||
/* return $this->terminateWithError('keine Berechtigung bro', self::ERROR_TYPE_GENERAL);*/
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -13,6 +13,7 @@ class Mylv extends Auth_Controller
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
|
||||
parent::__construct([
|
||||
'Student' => self::PERM_LOGGED,
|
||||
'Studiensemester' => self::PERM_LOGGED,
|
||||
@@ -44,13 +45,27 @@ class Mylv extends Auth_Controller
|
||||
public function Studiensemester()
|
||||
{
|
||||
$this->load->model('organisation/Studiensemester_model', 'StudiensemesterModel');
|
||||
$this->load->model('crm/Student_model', 'StudentModel');
|
||||
$this->load->model('ressource/Mitarbeiter_model', 'MitarbeiterModel');
|
||||
|
||||
$result = $this->StudiensemesterModel->getWhereStudentHasLvs(getAuthUID());
|
||||
$isMitarbeiter = getData($this->MitarbeiterModel->isMitarbeiter(getAuthUID())) ?? false;
|
||||
if($isMitarbeiter) {
|
||||
$result = $this->StudiensemesterModel->getWhereMitarbeiterHasLvs(getAuthUID());
|
||||
|
||||
if (isError($result))
|
||||
return $this->outputJsonError(getError($result));
|
||||
if (isError($result))
|
||||
return $this->outputJsonError(getError($result));
|
||||
|
||||
$this->outputJsonSuccess(getData($result));
|
||||
$this->outputJsonSuccess(getData($result));
|
||||
} else if(getData($this->StudentModel->isStudent(getAuthUID())) ?? false) { // $isStudent
|
||||
$result = $this->StudiensemesterModel->getWhereStudentHasLvs(getAuthUID());
|
||||
|
||||
if (isError($result))
|
||||
return $this->outputJsonError(getError($result));
|
||||
|
||||
$this->outputJsonSuccess(getData($result));
|
||||
} else {
|
||||
$this->outputJsonError('neither student or mitarbeiter');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -58,13 +73,27 @@ class Mylv extends Auth_Controller
|
||||
public function Lvs($studiensemester_kurzbz)
|
||||
{
|
||||
$this->load->model('education/Lehrveranstaltung_model', 'LehrveranstaltungModel');
|
||||
$this->load->model('crm/Student_model', 'StudentModel');
|
||||
$this->load->model('ressource/Mitarbeiter_model', 'MitarbeiterModel');
|
||||
|
||||
$result = $this->LehrveranstaltungModel->getLvsByStudentWithGrades(getAuthUID(), $studiensemester_kurzbz, getUserLanguage());
|
||||
$isMitarbeiter = getData($this->MitarbeiterModel->isMitarbeiter(getAuthUID())) ?? false;
|
||||
if($isMitarbeiter) {
|
||||
$result = $this->LehrveranstaltungModel->getLvsByMitarbeiterInSemester(getAuthUID(), $studiensemester_kurzbz);
|
||||
|
||||
if (isError($result))
|
||||
return $this->outputJsonError(getError($result));
|
||||
if (isError($result))
|
||||
return $this->outputJsonError(getError($result));
|
||||
|
||||
$this->outputJsonSuccess(getData($result));
|
||||
$this->outputJsonSuccess(getData($result));
|
||||
} else if(getData($this->StudentModel->isStudent(getAuthUID())) ?? false) { // $isStudent
|
||||
$result = $this->LehrveranstaltungModel->getLvsByStudentWithGrades(getAuthUID(), $studiensemester_kurzbz, getUserLanguage());
|
||||
|
||||
if (isError($result))
|
||||
return $this->outputJsonError(getError($result));
|
||||
|
||||
$this->outputJsonSuccess(getData($result));
|
||||
} else {
|
||||
$this->outputJsonError('neither student or mitarbeiter');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -73,7 +73,7 @@ class Attachment extends FHC_Controller
|
||||
}
|
||||
}
|
||||
|
||||
$result = $this->dmslib->getOutputFileInfo($dms_id);
|
||||
$result = $this->dmslib->download($dms_id);
|
||||
if (isError($result))
|
||||
return show_error(getError($result));
|
||||
|
||||
|
||||
@@ -215,8 +215,11 @@ class Pruefungsprotokoll extends Auth_Controller
|
||||
if (hasData($abschlusspruefung))
|
||||
{
|
||||
$abschlusspruefung_data = getData($abschlusspruefung);
|
||||
if ($this->permissionlib->isBerechtigt('admin') ||
|
||||
(isset($abschlusspruefung_data->studiengang_kz) && $this->permissionlib->isBerechtigt('assistenz', 'suid', $abschlusspruefung_data->studiengang_kz))
|
||||
if ($this->permissionlib->isBerechtigt('admin')
|
||||
|| (
|
||||
isset($abschlusspruefung_data->studiengang_kz)
|
||||
&& $this->permissionlib->isBerechtigt('assistenz', 'suid', $abschlusspruefung_data->studiengang_kz)
|
||||
)
|
||||
|| $this->_uid === $abschlusspruefung_data->uid_vorsitz)
|
||||
$result = $abschlusspruefung;
|
||||
else
|
||||
|
||||
@@ -393,7 +393,7 @@ class approveAnrechnungDetail extends Auth_Controller
|
||||
$filename = $this->anrechnunglib->setFilenameOnDownload($dms_id);
|
||||
|
||||
// Get file to be downloaded from DMS
|
||||
$download = $this->dmslib->getOutputFileInfo($dms_id, $filename);
|
||||
$download = $this->dmslib->download($dms_id, $filename);
|
||||
if (isError($download)) return $download;
|
||||
|
||||
// Download file
|
||||
|
||||
@@ -282,7 +282,7 @@ class approveAnrechnungUebersicht extends Auth_Controller
|
||||
$filename = $this->anrechnunglib->setFilenameOnDownload($dms_id);
|
||||
|
||||
// Get file to be downloaded from DMS
|
||||
$download = $this->dmslib->getOutputFileInfo($dms_id, $filename);
|
||||
$download = $this->dmslib->download($dms_id, $filename);
|
||||
if (isError($download)) return $download;
|
||||
|
||||
// Download file
|
||||
|
||||
@@ -150,12 +150,15 @@ class CreateAnrechnung extends Auth_Controller
|
||||
}
|
||||
|
||||
// Upload document
|
||||
$result = $this->_uploadFile();
|
||||
$result = self::_uploadFile();
|
||||
|
||||
if (isError($result)) $this->terminateWithJsonError(getError($result));
|
||||
if (isError($result))
|
||||
{
|
||||
$this->terminateWithJsonError($result->retval);
|
||||
}
|
||||
|
||||
// Hold just inserted DMS ID
|
||||
$lastInsert_dms_id = getData($result)->dms_id;
|
||||
$lastInsert_dms_id = $result->retval['dms_id'];
|
||||
|
||||
// Save Anrechnung and Anrechnungstatus
|
||||
$result = $this->AnrechnungModel->createAnrechnungsantrag(
|
||||
@@ -224,25 +227,17 @@ class CreateAnrechnung extends Auth_Controller
|
||||
*/
|
||||
private function _uploadFile()
|
||||
{
|
||||
// Upload document
|
||||
$uploadDataResult = $this->uploadFile('uploadfile', array('pdf'));
|
||||
|
||||
// If an error occurred while uploading the file
|
||||
if (isError($uploadDataResult)) return $uploadDataResult;
|
||||
if (!hasData($uploadDataResult)) return error('Upload failed');
|
||||
|
||||
// Add file to the DMS (DB + file system)
|
||||
return $this->_ci->dmslib->add(
|
||||
getData($uploadDataResult)['file_name'],
|
||||
getData($uploadDataResult)['file_type'],
|
||||
fopen(getData($uploadDataResult)['full_path'], 'r'),
|
||||
'anrechnung', // kategorie_kurzbz
|
||||
null, // dokument_kurzbz
|
||||
null, // beschreibung
|
||||
false, // cis_suche
|
||||
null, // schlagworte
|
||||
getAuthUID() // insertvon
|
||||
$dms = array(
|
||||
'kategorie_kurzbz' => 'anrechnung',
|
||||
'version' => 0,
|
||||
'name' => $_FILES['uploadfile']['name'],
|
||||
'mimetype' => $_FILES['uploadfile']['type'],
|
||||
'insertamum' => (new DateTime())->format('Y-m-d H:i:s'),
|
||||
'insertvon' => $this->_uid
|
||||
);
|
||||
|
||||
// Upload document
|
||||
return $this->dmslib->upload($dms, 'uploadfile', array('pdf'));
|
||||
}
|
||||
|
||||
private function _LVhasBlockingGrades($studiensemester_kurzbz, $lehrveranstaltung_id, $prestudent_id)
|
||||
@@ -273,4 +268,4 @@ class CreateAnrechnung extends Auth_Controller
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -83,7 +83,7 @@ class requestAnrechnung extends Auth_Controller
|
||||
$is_expired = $this->_isExpired($studiensemester_kurzbz);
|
||||
|
||||
// Check if Lehrveranstaltung was already graded with application blocking grades
|
||||
$is_blocked = $this->_LVhasBlockingGrades($studiensemester_kurzbz, $lehrveranstaltung_id);
|
||||
$is_blocked = self::_LVhasBlockingGrades($studiensemester_kurzbz, $lehrveranstaltung_id);
|
||||
|
||||
// Get Anrechung data
|
||||
$anrechnungData = $this->anrechnunglib->getAnrechnungDataByLv($lehrveranstaltung_id, $studiensemester_kurzbz, $prestudent_id);
|
||||
@@ -152,24 +152,27 @@ class requestAnrechnung extends Auth_Controller
|
||||
$prestudent_id = getData($result)[0]->prestudent_id;
|
||||
|
||||
// Exit if application already exists
|
||||
if ($this->_applicationExists($lehrveranstaltung_id, $studiensemester_kurzbz, $prestudent_id))
|
||||
if (self::_applicationExists($lehrveranstaltung_id, $studiensemester_kurzbz, $prestudent_id))
|
||||
{
|
||||
return $this->outputJsonError($this->p->t('anrechnung', 'antragBereitsGestellt'));
|
||||
}
|
||||
|
||||
// Exit if application is a past ( < actual ) studysemester
|
||||
if ($this->_applicationIsPastSS($studiensemester_kurzbz))
|
||||
if (self::_applicationIsPastSS($studiensemester_kurzbz))
|
||||
{
|
||||
return $this->outputJsonError($this->p->t('anrechnung', 'antragNichtFuerVerganganeSS'));
|
||||
}
|
||||
|
||||
// Upload document
|
||||
$result = $this->_uploadFile();
|
||||
$result = self::_uploadFile();
|
||||
|
||||
if (isError($result)) return $this->outputJsonError(getError($result));
|
||||
if (isError($result))
|
||||
{
|
||||
return $this->outputJsonError($result->retval);
|
||||
}
|
||||
|
||||
// Hold just inserted DMS ID
|
||||
$lastInsert_dms_id = getData($result)->dms_id;
|
||||
$lastInsert_dms_id = $result->retval['dms_id'];
|
||||
|
||||
// Save Anrechnung and Anrechnungstatus
|
||||
$result = $this->AnrechnungModel->createAnrechnungsantrag(
|
||||
@@ -179,8 +182,8 @@ class requestAnrechnung extends Auth_Controller
|
||||
$begruendung_id,
|
||||
$lastInsert_dms_id,
|
||||
$anmerkung,
|
||||
$begruendung_ects,
|
||||
$begruendung_lvinhalt
|
||||
$begruendung_ects,
|
||||
$begruendung_lvinhalt
|
||||
);
|
||||
|
||||
if (isError($result))
|
||||
@@ -212,11 +215,11 @@ class requestAnrechnung extends Auth_Controller
|
||||
$this->_checkIfEntitledToReadDMSDoc($dms_id);
|
||||
|
||||
// Get file to be downloaded from DMS
|
||||
$download = $this->dmslib->getOutputFileInfo($dms_id);
|
||||
if (isError($download)) return $download;
|
||||
$download = $this->dmslib->download($dms_id);
|
||||
if (isError($download)) return $download;
|
||||
|
||||
// Download file
|
||||
$this->outputFile(getData($download));
|
||||
// Download file
|
||||
$this->outputFile(getData($download));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -364,25 +367,16 @@ class requestAnrechnung extends Auth_Controller
|
||||
*/
|
||||
private function _uploadFile()
|
||||
{
|
||||
// Upload document
|
||||
$uploadDataResult = $this->uploadFile('uploadfile', array('pdf'));
|
||||
|
||||
// If an error occurred while uploading the file
|
||||
if (isError($uploadDataResult)) return $uploadDataResult;
|
||||
// If an error occurred while uploading the file
|
||||
if (!hasData($uploadDataResult)) return error('Upload failed');
|
||||
|
||||
// Add file to the DMS (DB + file system)
|
||||
return $this->_ci->dmslib->add(
|
||||
getData($uploadDataResult)['file_name'],
|
||||
getData($uploadDataResult)['file_type'],
|
||||
fopen(getData($uploadDataResult)['full_path'], 'r'),
|
||||
'anrechnung',
|
||||
null, // dokument_kurzbz
|
||||
null, // beschreibung
|
||||
false, // cis_suche
|
||||
null, // schlagworte
|
||||
getAuthUID() // insertvon
|
||||
$dms = array(
|
||||
'kategorie_kurzbz' => 'anrechnung',
|
||||
'version' => 0,
|
||||
'name' => $_FILES['uploadfile']['name'],
|
||||
'mimetype' => $_FILES['uploadfile']['type'],
|
||||
'insertamum' => (new DateTime())->format('Y-m-d H:i:s'),
|
||||
'insertvon' => $this->_uid
|
||||
);
|
||||
|
||||
// Upload document
|
||||
return $this->dmslib->upload($dms, 'uploadfile', array('pdf'));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -237,7 +237,7 @@ class reviewAnrechnungDetail extends Auth_Controller
|
||||
$filename = $this->anrechnunglib->setFilenameOnDownload($dms_id);
|
||||
|
||||
// Get file to be downloaded from DMS
|
||||
$download = $this->dmslib->getOutputFileInfo($dms_id, $filename);
|
||||
$download = $this->dmslib->download($dms_id, $filename);
|
||||
if (isError($download)) return $download;
|
||||
|
||||
// Download file
|
||||
|
||||
@@ -196,7 +196,7 @@ class reviewAnrechnungUebersicht extends Auth_Controller
|
||||
$filename = $this->anrechnunglib->setFilenameOnDownload($dms_id);
|
||||
|
||||
// Get file to be downloaded from DMS
|
||||
$download = $this->dmslib->getOutputFileInfo($dms_id, $filename);
|
||||
$download = $this->dmslib->download($dms_id, $filename);
|
||||
if (isError($download)) return $download;
|
||||
|
||||
// Download file
|
||||
|
||||
@@ -183,7 +183,6 @@ class InfoCenter extends Auth_Controller
|
||||
// Loads libraries
|
||||
$this->load->library('PersonLogLib');
|
||||
$this->load->library('WidgetLib');
|
||||
$this->load->library('AkteLib');
|
||||
|
||||
$this->load->config('infocenter');
|
||||
|
||||
@@ -457,7 +456,8 @@ class InfoCenter extends Auth_Controller
|
||||
|
||||
if (isset($akte_id) && isset($person_id))
|
||||
{
|
||||
$akte = $this->aktelib->getByAkteId($akte_id);
|
||||
$this->load->library('AkteLib');
|
||||
$akte = $this->aktelib->get($akte_id);
|
||||
|
||||
if (hasData($akte))
|
||||
{
|
||||
@@ -1173,6 +1173,8 @@ class InfoCenter extends Auth_Controller
|
||||
*/
|
||||
public function outputAkteContent($akte_id)
|
||||
{
|
||||
$this->load->library('DmsLib');
|
||||
|
||||
$akte = $this->AkteModel->load($akte_id);
|
||||
|
||||
if (isError($akte))
|
||||
@@ -1180,7 +1182,7 @@ class InfoCenter extends Auth_Controller
|
||||
show_error(getError($akte));
|
||||
}
|
||||
|
||||
$aktecontent = $this->aktelib->getByAkteId($akte_id);
|
||||
$aktecontent = $this->dmslib->getAkteContent($akte_id);
|
||||
|
||||
if (isError($aktecontent))
|
||||
{
|
||||
@@ -2484,5 +2486,4 @@ class InfoCenter extends Auth_Controller
|
||||
$this->loglib->logError('Studiengang has no mail for sending Freigabe mail');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -136,77 +136,37 @@ abstract class FHC_Controller extends CI_Controller
|
||||
/**
|
||||
* To download the given file represented by the fileObj parameter.
|
||||
* fileObj has the following structure:
|
||||
* $fileObj->file OR $fileObj->file_content
|
||||
* $fileObj->filename
|
||||
* $fileObj->file
|
||||
* $fileObj->name
|
||||
* $fileObj->mimetype
|
||||
* $fileObj->disposition (inline OR attachment)
|
||||
* $fileObj->disposition
|
||||
*/
|
||||
protected function outputFile($fileObj)
|
||||
{
|
||||
// If the file exists
|
||||
if ((isset($fileObj->file) && !isEmptyString($fileObj->file) && file_exists($fileObj->file))
|
||||
|| (isset($fileObj->file_content) && !isEmptyString($fileObj->file_content)))
|
||||
if (isset($fileObj->file) && !isEmptyString($fileObj->file) && file_exists($fileObj->file))
|
||||
{
|
||||
$content_length = 0;
|
||||
|
||||
// If file content has been provided
|
||||
if (isset($fileObj->file_content) && !isEmptyString($fileObj->file_content))
|
||||
{
|
||||
$content_length = strlen($fileObj->file_content);
|
||||
}
|
||||
else // otherwise the path + name of the file
|
||||
{
|
||||
$content_length = filesize($fileObj->file);
|
||||
}
|
||||
|
||||
header('Content-Description: File Transfer');
|
||||
header('Content-Type: '. $fileObj->mimetype);
|
||||
header('Content-Length: ' . $content_length);
|
||||
header('Content-Transfer-Encoding: binary');
|
||||
header('Content-Disposition: '. $fileObj->disposition. '; filename="'. $fileObj->name. '"');
|
||||
header('Cache-Control: no-store, no-cache, must-revalidate, max-age=0');
|
||||
header('Expires: ' . date("D, d M Y H:i:s", time()));
|
||||
header('Expires: 0');
|
||||
header('Cache-Control: must-revalidate');
|
||||
header('Pragma: public');
|
||||
header('Content-Length: ' . filesize($fileObj->file));
|
||||
|
||||
// Clean the output buffer
|
||||
flush();
|
||||
|
||||
// If file content has been provided
|
||||
if (isset($fileObj->file_content) && !isEmptyString($fileObj->file_content))
|
||||
if (isset($fileObj->disposition)
|
||||
&& ($fileObj->disposition == 'inline' || $fileObj->disposition == 'attachment'))
|
||||
{
|
||||
echo $fileObj->file_content;
|
||||
}
|
||||
else // otherwise get the content from file system
|
||||
{
|
||||
readfile($fileObj->file);
|
||||
header('Content-Disposition: '. $fileObj->disposition. '; filename="'. $fileObj->name. '"');
|
||||
}
|
||||
|
||||
// Terminate the execution
|
||||
exit();
|
||||
readfile($fileObj->file); // reads the file content to the output buffer
|
||||
}
|
||||
else
|
||||
{
|
||||
// Otherwise print an error
|
||||
show_error('The provided file does not exist: '.(isset($fileObj->file) ? $fileObj->file : 'file not given'));
|
||||
}
|
||||
|
||||
// Otherwise return an error
|
||||
show_error('The provided file does not exist or file content is empty');
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
protected function outputImageByContent($mimetype, $file_content)
|
||||
{
|
||||
if (isEmptyString($file_content)) show_error('The provided file content is not valid');
|
||||
|
||||
$this->_outputImage($mimetype, $file_content);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
protected function outputImageByFile($mimetype, $file_name)
|
||||
{
|
||||
if (!file_exists($file_name)) show_error('The provided file does not exist');
|
||||
|
||||
$this->_outputImage($mimetype, null, $file_name);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -218,29 +178,6 @@ abstract class FHC_Controller extends CI_Controller
|
||||
return json_decode($this->input->raw_input_stream);
|
||||
}
|
||||
|
||||
/**
|
||||
* Utility function to upload a file
|
||||
* - post_field_name: the name of the field in the HTTP POST payload, this is also the index in the super global $_FILES array
|
||||
* - allowed_types: a list of file extensions that are allowed to be uploaded (ex. array('pdf', 'odt') or array('jpg', 'jpeg', 'gif')
|
||||
*/
|
||||
protected function uploadFile($post_field_name, $allowed_types = array('*'))
|
||||
{
|
||||
$this->load->library(
|
||||
'upload',
|
||||
array(
|
||||
'upload_path' => sys_get_temp_dir(),
|
||||
'allowed_types' => $allowed_types,
|
||||
'overwrite' => true
|
||||
)
|
||||
);
|
||||
|
||||
// If the upload was a success then return the uploaded file info
|
||||
if ($this->upload->do_upload($post_field_name)) return success($this->upload->data());
|
||||
|
||||
// If an error occurred then return it without tags
|
||||
return error($this->upload->display_errors('', ''));
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Private methods
|
||||
|
||||
@@ -256,44 +193,5 @@ abstract class FHC_Controller extends CI_Controller
|
||||
show_error('This web site cannot work correctly without the HTTPS protocol enabled');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private function _outputImage($mimetype, $file_content = null, $file_name = null)
|
||||
{
|
||||
$content_length = 0;
|
||||
|
||||
// If file content has been provided
|
||||
if ($file_content != null)
|
||||
{
|
||||
$content_length = strlen($file_content);
|
||||
}
|
||||
else // otherwise the path + name of the file
|
||||
{
|
||||
$content_length = filesize($file_name);
|
||||
}
|
||||
|
||||
header('Content-Type: '. $mimetype);
|
||||
header('Content-Length: ' . $content_length);
|
||||
header('Cache-Control: no-store, no-cache, must-revalidate, max-age=0');
|
||||
header('Expires: ' . date("D, d M Y H:i:s", time()));
|
||||
|
||||
// Clean the output buffer
|
||||
flush();
|
||||
|
||||
// If file content has been provided
|
||||
if ($file_content != null)
|
||||
{
|
||||
echo $file_content;
|
||||
}
|
||||
else // otherwise get the content from file system
|
||||
{
|
||||
readfile($file_name);
|
||||
}
|
||||
|
||||
// Terminate the execution
|
||||
exit();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -196,39 +196,26 @@ abstract class Notiz_Controller extends FHCAPI_Controller
|
||||
$dms_id_arr = [];
|
||||
foreach ($_FILES as $k => $file)
|
||||
{
|
||||
$dms = array(
|
||||
'kategorie_kurzbz' => 'notiz',
|
||||
'version' => 0,
|
||||
'name' => $file["name"],
|
||||
'mimetype' => $file["type"],
|
||||
'insertamum' => date('c'),
|
||||
'insertvon' => $uid
|
||||
);
|
||||
|
||||
//Todo(manu) check if filetypes weiter eingeschränkt werden sollen
|
||||
//Todo(manu)check name files: nicht gleiches file 2mal hochladen
|
||||
//Todo define in dms component: readFile, downloadFile
|
||||
$uploadDataResult = $this->uploadFile($k);
|
||||
if (isError($uploadDataResult))
|
||||
$result = $this->dmslib->upload($dms, $k, ['*']);
|
||||
/* $result = $this->dmslib->upload($dms, $k, ['application/pdf','application/x.fhc-dms+json']);*/
|
||||
if (isError($result))
|
||||
{
|
||||
$this->db->trans_rollback();
|
||||
$this->terminateWithError(getError($uploadDataResult), self::ERROR_TYPE_GENERAL);
|
||||
$this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
if (!hasData($uploadDataResult))
|
||||
{
|
||||
$this->db->trans_rollback();
|
||||
$this->terminateWithError('Upload failed', self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
|
||||
// Add file to the DMS (DB + file system)
|
||||
$addResult = $this->dmslib->add(
|
||||
getData($uploadDataResult)['file_name'],
|
||||
getData($uploadDataResult)['file_type'],
|
||||
fopen(getData($uploadDataResult)['full_path'], 'r'),
|
||||
'notiz', // kategorie_kurzbz
|
||||
null, // dokument_kurzbz
|
||||
null, // beschreibung
|
||||
false, // cis_suche
|
||||
null, // schlagworte
|
||||
getAuthUID() // insertvon
|
||||
);
|
||||
|
||||
// If error occurred
|
||||
if (isError($addResult) || !hasData($addResult))
|
||||
$this->terminateWithError(getError($addResult), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
$dms_id_arr[] = getData($addResult)->dms_id;
|
||||
$dms_id_arr[] = $result->retval['dms_id'];
|
||||
}
|
||||
|
||||
//save entry in Notizdokument
|
||||
@@ -332,40 +319,22 @@ abstract class Notiz_Controller extends FHCAPI_Controller
|
||||
}
|
||||
else
|
||||
{
|
||||
$dms = array(
|
||||
'kategorie_kurzbz' => 'notiz',
|
||||
'version' => 0,
|
||||
'name' => $file["name"],
|
||||
'mimetype' => $file["type"],
|
||||
'insertamum' => date('c'),
|
||||
'insertvon' => $uid
|
||||
);
|
||||
|
||||
//Todo(manu) check if filetypes weiter eingeschränkt werden sollen
|
||||
//Todo(manu)check name files: nicht gleiches file 2mal hochladen
|
||||
//Todo define in dms component: readFile, downloadFile
|
||||
$uploadDataResult = $this->uploadFile($k);
|
||||
if (isError($uploadDataResult))
|
||||
{
|
||||
$this->db->trans_rollback();
|
||||
$this->terminateWithError(getError($uploadDataResult), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
if (!hasData($uploadDataResult))
|
||||
{
|
||||
$this->db->trans_rollback();
|
||||
$this->terminateWithError('Upload failed', self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
$result = $this->dmslib->upload($dms, $k, array('*'));
|
||||
|
||||
// Add file to the DMS (DB + file system)
|
||||
$addResult = $this->dmslib->add(
|
||||
getData($uploadDataResult)['file_name'],
|
||||
getData($uploadDataResult)['file_type'],
|
||||
fopen(getData($uploadDataResult)['full_path'], 'r'),
|
||||
'notiz', // kategorie_kurzbz
|
||||
null, // dokument_kurzbz
|
||||
null, // beschreibung
|
||||
false, // cis_suche
|
||||
null, // schlagworte
|
||||
getAuthUID() // insertvon
|
||||
);
|
||||
|
||||
// If error occurred
|
||||
if (isError($addResult) || !hasData($addResult))
|
||||
$this->terminateWithError(getError($addResult), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
$addResult = $this->getDataOrTerminateWithError($addResult);
|
||||
$dms_id = $addResult['dms_id'];
|
||||
$result = $this->getDataOrTerminateWithError($result);
|
||||
$dms_id = $result['dms_id'];
|
||||
|
||||
$result = $this->NotizdokumentModel->insert(array('notiz_id' => $post_data['notiz_id'], 'dms_id' => $dms_id));
|
||||
|
||||
|
||||
@@ -418,10 +418,10 @@ function findResource($path, $resource, $subdir = false, $extraDir = null)
|
||||
if (!function_exists('array_is_list')) {
|
||||
function array_is_list(array $arr)
|
||||
{
|
||||
if ($arr === []) {
|
||||
return true;
|
||||
}
|
||||
return array_keys($arr) === range(0, count($arr) - 1);
|
||||
if ($arr === []) {
|
||||
return true;
|
||||
}
|
||||
return array_keys($arr) === range(0, count($arr) - 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -82,6 +82,21 @@ function generateCSSsInclude($CSSs)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates tags for the style sheets you want to include, the parameter could by a string or an array of strings
|
||||
*/
|
||||
function generatePrintCSS($path)
|
||||
{
|
||||
$cssLink = '<link rel="stylesheet" media="print" href="%s" />';
|
||||
|
||||
$ci =& get_instance();
|
||||
$cachetoken = '?'.$ci->config->item('fhcomplete_build_version');
|
||||
|
||||
if (isset($path)) {
|
||||
echo sprintf($cssLink, base_url($path).$cachetoken) . PHP_EOL;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates global JS-Object to pass parms to other javascripts
|
||||
*/
|
||||
|
||||
+124
-203
@@ -1,21 +1,12 @@
|
||||
<?php
|
||||
|
||||
/* Copyright (C) 2025 fhcomplete.net
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||
/**
|
||||
* FH-Complete
|
||||
*
|
||||
* @package FHC-Helper
|
||||
* @author FHC-Team
|
||||
* @copyright Copyright (c) 2022 fhcomplete.net
|
||||
* @license GPLv3
|
||||
*/
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
@@ -130,32 +121,90 @@ class AkteLib
|
||||
* Gets akte data and associated dms data by akte Id
|
||||
* Returns success with akte and dms data or error
|
||||
*/
|
||||
public function getByAkteId($akte_id, $dokument_kurzbz = null, $archiv = null, $signiert = null, $stud_selfservice = null)
|
||||
public function get($akte_id)
|
||||
{
|
||||
return $this->_get(
|
||||
$akte_id,
|
||||
null, // person_id
|
||||
$dokument_kurzbz,
|
||||
$archiv,
|
||||
$signiert,
|
||||
$stud_selfservice
|
||||
);
|
||||
// get Akte data
|
||||
$this->_ci->AkteModel->addSelect('person_id, dokument_kurzbz, mimetype, erstelltam, titel, bezeichnung,
|
||||
gedruckt, uid, dms_id, nachgereicht, nachgereicht_am, anmerkung,
|
||||
ausstellungsnation, formal_geprueft_amum, archiv, signiert,
|
||||
stud_selfservice, akzeptiertamum, insertvon, insertamum, updatevon, updateamum');
|
||||
$this->_ci->AkteModel->load($akte_id);
|
||||
$akteResult = $this->_ci->AkteModel->load($akte_id);
|
||||
|
||||
if (isError($akteResult)) return $akteResult;
|
||||
|
||||
if (!hasData($akteResult)) return error("Akte not found");
|
||||
|
||||
$resultObject = getData($akteResult)[0];
|
||||
|
||||
// set properties with same name in Akte and Dms table
|
||||
$resultObject->akte_mimetype = $resultObject->mimetype;
|
||||
|
||||
// get dms data
|
||||
$dmsResult = $this->_ci->dmslib->getLastVersion($resultObject->dms_id);
|
||||
|
||||
if (isError($dmsResult)) return $dmsResult;
|
||||
|
||||
// properties to retrieve from dms
|
||||
$dmsProperties = array('version', 'filename', 'mimetype', 'name', 'beschreibung', 'cis_suche', 'schlagworte', DmsLib::FILE_CONTENT_PROPERTY);
|
||||
|
||||
// set dms properties
|
||||
if (hasData($dmsResult))
|
||||
{
|
||||
$dmsData = getData($dmsResult);
|
||||
|
||||
foreach ($dmsProperties as $dmsProperty)
|
||||
{
|
||||
$resultObject->{$dmsProperty} = $dmsData->{$dmsProperty};
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// set null if no dms result found
|
||||
foreach ($dmsProperties as $dmsProperty)
|
||||
{
|
||||
$resultObject->{$dmsProperty} = null;
|
||||
}
|
||||
}
|
||||
|
||||
// return the object containing akte and dms data
|
||||
return success($resultObject);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets Akte data and associated dms data by person Id and dokument_kurzbz
|
||||
* Returns success with result array with akte and dms data or error
|
||||
*/
|
||||
public function getByPersonId($person_id, $dokument_kurzbz = null, $archiv = null, $signiert = null, $stud_selfservice = null)
|
||||
public function getByPersonIdAndDocumentType($person_id, $dokument_kurzbz)
|
||||
{
|
||||
return $this->_get(
|
||||
null, // akte_id
|
||||
$person_id,
|
||||
$dokument_kurzbz,
|
||||
$archiv,
|
||||
$signiert,
|
||||
$stud_selfservice
|
||||
// load all Akte entries for given person and dokument_kurzbz
|
||||
$this->_ci->AkteModel->addSelect('akte_id');
|
||||
$akteResult = $this->_ci->AkteModel->loadWhere(
|
||||
array(
|
||||
'person_id' => $person_id,
|
||||
'dokument_kurzbz' => $dokument_kurzbz
|
||||
)
|
||||
);
|
||||
|
||||
if (!hasData($akteResult)) return error("Akte not found");
|
||||
|
||||
$akteData = getData($akteResult);
|
||||
|
||||
$resultArr = array();
|
||||
|
||||
// for each found akte entry
|
||||
foreach ($akteData as $akte)
|
||||
{
|
||||
// get dms and akte data from akte Id
|
||||
$getAkteDmsResult = $this->get($akte->akte_id);
|
||||
|
||||
if (isError($getAkteDmsResult)) return $getAkteDmsResult;
|
||||
|
||||
$resultArr[] = getData($getAkteDmsResult);
|
||||
}
|
||||
|
||||
// return all found entries
|
||||
return success($resultArr);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -164,184 +213,56 @@ class AkteLib
|
||||
*/
|
||||
public function remove($akte_id)
|
||||
{
|
||||
return $this->_remove($akte_id, null, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes Akte by $person_id and $dms_id, removes all associated dms entries and versions, and deletes all associated files
|
||||
* Returns success with removed version numbers or error
|
||||
*/
|
||||
public function removeByPersonIdAndDmsId($person_id, $dms_id)
|
||||
{
|
||||
return $this->_remove(null, $person_id, $dms_id);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private function _get($akte_id = null, $person_id = null, $dokument_kurzbz = null, $archiv = null, $signiert = null, $stud_selfservice = null)
|
||||
{
|
||||
$dbModel = new DB_Model();
|
||||
|
||||
$query = 'SELECT akte_id,
|
||||
person_id,
|
||||
dokument_kurzbz,
|
||||
inhalt,
|
||||
CASE WHEN inhalt is not null THEN true ELSE false END as inhalt_vorhanden,
|
||||
mimetype,
|
||||
erstelltam,
|
||||
gedruckt,
|
||||
titel,
|
||||
bezeichnung,
|
||||
updateamum,
|
||||
updatevon,
|
||||
insertamum,
|
||||
insertvon,
|
||||
uid,
|
||||
dms_id,
|
||||
nachgereicht,
|
||||
anmerkung,
|
||||
titel_intern,
|
||||
anmerkung_intern,
|
||||
nachgereicht_am,
|
||||
ausstellungsnation,
|
||||
formal_geprueft_amum,
|
||||
archiv,
|
||||
signiert,
|
||||
stud_selfservice,
|
||||
akzeptiertamum
|
||||
FROM public.tbl_akte
|
||||
WHERE TRUE';
|
||||
|
||||
// Query parameters
|
||||
$paramArray = array();
|
||||
|
||||
// akte_id
|
||||
if (is_numeric($akte_id) || is_array($akte_id))
|
||||
{
|
||||
$paramArray[] = $akte_id;
|
||||
if (is_numeric($akte_id)) $query .= ' AND akte_id = ?';
|
||||
if (is_array($akte_id)) $query .= ' AND akte_id IN ?';
|
||||
}
|
||||
|
||||
// person_id
|
||||
if (is_numeric($person_id) || is_array($person_id))
|
||||
{
|
||||
$paramArray[] = $person_id;
|
||||
if (is_numeric($person_id)) $query .= ' AND person_id = ?';
|
||||
if (is_array($person_id)) $query .= ' AND person_id IN ?';
|
||||
}
|
||||
|
||||
// dokument_kurzbz
|
||||
if (!isEmptyString($dokument_kurzbz))
|
||||
{
|
||||
$paramArray[] = $dokument_kurzbz;
|
||||
$query .= ' AND dokument_kurzbz = ?';
|
||||
}
|
||||
|
||||
// archiv
|
||||
if (is_bool($archiv))
|
||||
{
|
||||
$paramArray[] = $archiv;
|
||||
$query .= ' AND archiv = ?';
|
||||
}
|
||||
|
||||
// signiert
|
||||
if (is_bool($signiert))
|
||||
{
|
||||
$paramArray[] = $signiert;
|
||||
$query .= ' AND signiert = ?';
|
||||
}
|
||||
|
||||
// stud_selfservice
|
||||
if (is_bool($stud_selfservice))
|
||||
{
|
||||
$paramArray[] = $stud_selfservice;
|
||||
$query .= ' AND stud_selfservice = ?';
|
||||
}
|
||||
|
||||
// If no parameters has been provided exit
|
||||
if (isEmptyArray($paramArray)) return error('Called without giving any parameter');
|
||||
|
||||
// Loads data from DB
|
||||
$akteResult = $dbModel->execReadOnlyQuery($query, $paramArray);
|
||||
|
||||
// If error or data not found then exit
|
||||
if (isError($akteResult)) return $akteResult;
|
||||
if (!hasData($akteResult)) return error('Akte not found');
|
||||
|
||||
// For each record from the akte
|
||||
foreach (getData($akteResult) as $resultObject)
|
||||
{
|
||||
// get dms data
|
||||
$dmsResult = $this->_ci->dmslib->getLastVersion($resultObject->dms_id);
|
||||
|
||||
if (isError($dmsResult)) return $dmsResult;
|
||||
|
||||
// properties to retrieve from dms
|
||||
$dmsProperties = array('version', 'filename', 'mimetype', 'name', 'beschreibung', 'cis_suche', 'schlagworte');
|
||||
|
||||
// set dms properties
|
||||
if (hasData($dmsResult))
|
||||
{
|
||||
$dmsData = getData($dmsResult)[0];
|
||||
|
||||
foreach ($dmsProperties as $dmsProperty)
|
||||
{
|
||||
// If the property is _not_ 'mimetype' _or_
|
||||
// If the mimetype from the akte table is null then overwrite it with the one from the DMS
|
||||
if ($dmsProperty != 'mimetype' || ($dmsProperty == 'mimetype' && $resultObject->{$dmsProperty} == null))
|
||||
{
|
||||
$resultObject->{$dmsProperty} = $dmsData->{$dmsProperty};
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Set null if no dms result found
|
||||
foreach ($dmsProperties as $dmsProperty)
|
||||
{
|
||||
if ($dmsProperty != 'mimetype') $resultObject->{$dmsProperty} = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// return the object containing akte and dms data
|
||||
return success(getData($akteResult));
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes Akte by akte Id, person id and/or dms id
|
||||
* Removes all associated dms entries and versions, and deletes all associated files
|
||||
* Returns success with removed version numbers or error
|
||||
*/
|
||||
private function _remove($akte_id = null, $person_id = null, $dms_id = null)
|
||||
{
|
||||
// Get dms_id for akte
|
||||
$this->_ci->AkteModel->addSelect('akte_id');
|
||||
// get dms_id for akte
|
||||
$this->_ci->AkteModel->addSelect('dms_id');
|
||||
|
||||
$paramArray = array();
|
||||
|
||||
if (is_numeric($akte_id)) $paramArray['akte_id'] = $akte_id;
|
||||
if (is_numeric($person_id)) $paramArray['person_id'] = $person_id;
|
||||
if (is_numeric($dms_id)) $paramArray['dms_id'] = $dms_id;
|
||||
|
||||
$akteResult = $this->_ci->AkteModel->loadWhere($paramArray);
|
||||
$akteResult = $this->_ci->AkteModel->load($akte_id);
|
||||
|
||||
if (isError($akteResult)) return $akteResult;
|
||||
|
||||
if (!hasData($akteResult)) return error('Akte not found');
|
||||
if (!hasData($akteResult)) return error("Akte not found");
|
||||
|
||||
// Delete Akte
|
||||
$deleteResult = $this->_ci->AkteModel->delete(getData($akteResult)[0]->akte_id);
|
||||
$dms_id = getData($akteResult)[0]->dms_id;
|
||||
$error = null;
|
||||
|
||||
if (isError($deleteResult)) return $deleteResult;
|
||||
// Start DB transaction to avoid deleting only part of the data
|
||||
$this->_ci->db->trans_begin();
|
||||
|
||||
// Remove all dms entry for dms of the akte
|
||||
$removeAllResult = $this->_ci->dmslib->removeAll(getData($akteResult)[0]->dms_id);
|
||||
// delete Akte
|
||||
$deleteResult = $this->_ci->AkteModel->delete($akte_id);
|
||||
|
||||
return $removeAllResult;
|
||||
if (isError($deleteResult))
|
||||
{
|
||||
$error = $deleteResult;
|
||||
}
|
||||
else
|
||||
{
|
||||
// remove all dms entry for dms of the akte
|
||||
$removeAllResult = $this->_ci->dmslib->removeAll($dms_id);
|
||||
|
||||
if (isError($removeAllResult))
|
||||
$error = $removeAllResult;
|
||||
}
|
||||
|
||||
// Transaction complete!
|
||||
$this->_ci->db->trans_complete();
|
||||
|
||||
// Check if everything went ok during the transaction
|
||||
if ($this->_ci->db->trans_status() === false || isset($error))
|
||||
{
|
||||
$this->_ci->db->trans_rollback();
|
||||
|
||||
// return occured error
|
||||
if (isset($error))
|
||||
return $error;
|
||||
else
|
||||
return error("Error occured when deleting, rolled back");
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->_ci->db->trans_commit();
|
||||
|
||||
// return removed dms entry data
|
||||
return $removeAllResult;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ if (!defined('BASEPATH'))
|
||||
exit('No direct script access allowed');
|
||||
|
||||
use \DateTime as DateTime;
|
||||
use \DateInterval as DateInterval;
|
||||
use \DOMDocument as DOMDocument;
|
||||
use \XSLTProcessor as XSLTProcessor;
|
||||
|
||||
@@ -141,63 +142,6 @@ class CmsLib
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param stdClass $stg_obj
|
||||
*
|
||||
* @return stdClass
|
||||
*/
|
||||
protected function getNewsExtras($stg_obj, $semester)
|
||||
{
|
||||
$this->ci->load->model('person/Benutzerfunktion_model', 'BenutzerfunktionModel');
|
||||
|
||||
$stg_ltg = $this->ci->StudiengangModel->getLeitungDetailed($stg_obj->studiengang_kz);
|
||||
if (isError($stg_ltg))
|
||||
return $stg_ltg;
|
||||
$stg_ltg = getData($stg_ltg) ?: [];
|
||||
|
||||
$gf_ltg = $this->ci->BenutzerfunktionModel->getBenutzerFunktionenDetailed('gLtg', $stg_obj->oe_kurzbz);
|
||||
if (isError($gf_ltg))
|
||||
return $gf_ltg;
|
||||
$gf_ltg = getData($gf_ltg) ?: [];
|
||||
|
||||
$stv_ltg = $this->ci->BenutzerfunktionModel->getBenutzerFunktionenDetailed('stvLtg', $stg_obj->oe_kurzbz);
|
||||
if (isError($stv_ltg))
|
||||
return $stv_ltg;
|
||||
$stv_ltg = getData($stv_ltg) ?: [];
|
||||
|
||||
$ass = $this->ci->BenutzerfunktionModel->getBenutzerFunktionenDetailed('ass', $stg_obj->oe_kurzbz);
|
||||
if (isError($ass))
|
||||
return $ass;
|
||||
$ass = getData($ass) ?: [];
|
||||
|
||||
$hochschulvertr = $this->ci->BenutzerfunktionModel->getBenutzerFunktionenDetailed('hsv');
|
||||
if (isError($hochschulvertr))
|
||||
return $hochschulvertr;
|
||||
$hochschulvertr = getData($hochschulvertr) ?: [];
|
||||
|
||||
$stdv = $this->ci->BenutzerfunktionModel->getBenutzerFunktionenDetailed('stdv', $stg_obj->oe_kurzbz);
|
||||
if (isError($stdv))
|
||||
return $stdv;
|
||||
$stdv = getData($stdv) ?: [];
|
||||
|
||||
$jahrgangsvertr = $this->ci->BenutzerfunktionModel->getBenutzerFunktionenDetailed('jgv', $stg_obj->oe_kurzbz, $semester);
|
||||
if (isError($jahrgangsvertr))
|
||||
return $jahrgangsvertr;
|
||||
$jahrgangsvertr = getData($jahrgangsvertr) ?: [];
|
||||
|
||||
return success($this->ci->load->view('Cis/Cms/News/Xml/NewsExtras', [
|
||||
'studiengang' => $stg_obj,
|
||||
'semester' => $semester,
|
||||
'stg_ltg' => $stg_ltg,
|
||||
'gf_ltg' => $gf_ltg,
|
||||
'stv_ltg' => $stv_ltg,
|
||||
'ass' => $ass,
|
||||
'hochschulvertr' => $hochschulvertr,
|
||||
'stdv' => $stdv,
|
||||
'jahrgangsvertr' => $jahrgangsvertr
|
||||
], true));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $studiengang_kz
|
||||
* @param string $semester
|
||||
@@ -233,64 +177,102 @@ class CmsLib
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function getNews($infoscreen = false, $studiengang_kz = null, $semester = null, $mischen = true, $titel = '', $edit = false, $sichtbar = true, $page = 1, $page_size = 10, $sprache)
|
||||
public function getNews($infoscreen = false, $studiengang_kz = null, $semester = null, $mischen = true, $titel = '', $edit = false, $sichtbar = true, $page = 1, $page_size = 10, $sprache, $filterForDegreePrograms = false, $allowedDegreePrograms = [], $active = true)
|
||||
|
||||
{
|
||||
$this->ci->load->model('organisation/Studiengang_model', 'StudiengangModel');
|
||||
list($studiengang_kz, $semester) = $this->getStgAndSem($studiengang_kz, $semester);
|
||||
$all = $edit;
|
||||
|
||||
$xml = '<?xml version="1.0" encoding="UTF-8"?><content>';
|
||||
|
||||
$this->ci->load->model('content/News_model', 'NewsModel');
|
||||
$news = $this->ci->NewsModel->getNewsWithContent($sprache, $studiengang_kz, $semester, null, $sichtbar, 0, $page, $page_size, $all, $mischen);
|
||||
|
||||
if (isError($news))
|
||||
return $news;
|
||||
|
||||
$news = getData($news);
|
||||
|
||||
|
||||
$news = $this->ci->NewsModel->getNewsWithContent($sprache, $studiengang_kz, $semester, null, $sichtbar, $page, $page_size, $active, $mischen, $filterForDegreePrograms, $allowedDegreePrograms);
|
||||
$news = getData($news) ?? [];
|
||||
$newsWrappers = [];
|
||||
|
||||
foreach ($news as $newsobj) {
|
||||
if ($studiengang_kz && $edit && !$newsobj->studiengang_kz)
|
||||
continue;
|
||||
$date = new DateTime($newsobj->datum);
|
||||
$datum = '<datum><![CDATA[' . $date->format('d.m.Y') . ']]></datum>';
|
||||
$datum .= '<datumdetail><![CDATA[' . $date->format('Y-m-d H:i') . ']]></datumdetail>';
|
||||
$id = $edit ? '<news_id><![CDATA[' . $newsobj->news_id . ']]></news_id>' : '';
|
||||
$xml .= "<newswrapper>" . $newsobj->content . $datum . $id . "</newswrapper>";
|
||||
|
||||
$newsWrappers[] = $this->createNewsWrapper($newsobj, $edit);
|
||||
}
|
||||
|
||||
/* if ($studiengang_kz != 0) {
|
||||
$stg_obj = $this->ci->StudiengangModel->load($studiengang_kz);
|
||||
if (isError($stg_obj))
|
||||
return $stg_obj;
|
||||
$stg_obj = current(getData($stg_obj) ?: []);
|
||||
$content = $this->createNewsContent($newsWrappers, $infoscreen, $titel);
|
||||
if (isError($content))
|
||||
return $content;
|
||||
|
||||
if ($stg_obj) {
|
||||
if (!$edit && !$infoscreen) {
|
||||
$extras = $this->getNewsExtras($stg_obj, $semester);
|
||||
if (isError($extras))
|
||||
return $extras;
|
||||
$xml .= getData($extras);
|
||||
}
|
||||
$xml .= '<studiengang_bezeichnung><![CDATA[' . $stg_obj->bezeichnung . ']]></studiengang_bezeichnung>';
|
||||
}
|
||||
} */
|
||||
return success([
|
||||
"content" => getData($content),
|
||||
"row_count" => $news[0]->row_count ?? 0
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a newswrapper XML element from a news item.
|
||||
*
|
||||
* @param stdClass $newsobj
|
||||
* @param boolean $edit
|
||||
*
|
||||
* @return DOMElement
|
||||
*/
|
||||
public function createNewsWrapper($newsobj, $edit)
|
||||
{
|
||||
$id = $edit ? '<news_id><![CDATA[' . $newsobj->news_id . ']]></news_id>' : '';
|
||||
$isPublished = $edit ? '<is_published><![CDATA[' . ($newsobj->sichtbar ? 'true' : 'false') . ']]></is_published>' : '';
|
||||
|
||||
$date = new DateTime($newsobj->datum);
|
||||
$datum = '<datum><![CDATA[' . $date->format('d.m.Y') . ']]></datum>';
|
||||
$datum .= '<datumdetail><![CDATA[' . $date->format('Y-m-d H:i') . ']]></datumdetail>';
|
||||
|
||||
$hasVisibleToDate = isset($newsobj->datum_bis) && $newsobj->datum_bis !== '';
|
||||
$datumTo = $hasVisibleToDate
|
||||
? new DateTime($newsobj->datum_bis)
|
||||
: (clone $date)->add(new DateInterval('P' . MAXNEWSALTER . 'D'));
|
||||
if ($hasVisibleToDate)
|
||||
$datumTo->setTime(23, 59, 59);
|
||||
|
||||
$now = new DateTime();
|
||||
$isActive = '<is_active><![CDATA[' . ($datumTo >= $now ? 'true' : 'false') . ']]></is_active>';
|
||||
|
||||
$newsWrapper = new DOMDocument();
|
||||
$newsWrapper->loadXML('<newswrapper>' . $newsobj->content . $datum . $id . $isPublished . $isActive . '</newswrapper>');
|
||||
|
||||
return $newsWrapper->documentElement;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates rendered news content from one or more newswrapper XML elements.
|
||||
*
|
||||
* @param DOMElement|array $newsWrappers
|
||||
* @param boolean $infoscreen
|
||||
* @param string $titel
|
||||
*
|
||||
* @return stdClass
|
||||
*/
|
||||
public function createNewsContent($newsWrappers, $infoscreen, $titel)
|
||||
{
|
||||
if (!is_array($newsWrappers))
|
||||
$newsWrappers = [$newsWrappers];
|
||||
|
||||
$XML = new DOMDocument('1.0', 'UTF-8');
|
||||
$contentElement = $XML->createElement('content');
|
||||
$XML->appendChild($contentElement);
|
||||
|
||||
foreach ($newsWrappers as $newsWrapper)
|
||||
$contentElement->appendChild($XML->importNode($newsWrapper, true));
|
||||
|
||||
if ($titel != '') {
|
||||
$xml .= '<news_titel>' . $titel . '</news_titel>';
|
||||
$titleElement = $XML->createElement('news_titel');
|
||||
$titleElement->appendChild($XML->createTextNode($titel));
|
||||
$contentElement->appendChild($titleElement);
|
||||
}
|
||||
|
||||
$xml .= '</content>';
|
||||
|
||||
//XSLT Vorlage laden
|
||||
$template = $this->ci->TemplateModel->load($infoscreen ? 'news_infoscreen' : 'news');
|
||||
if (isError($template))
|
||||
return $template;
|
||||
$template = current(getData($template));
|
||||
|
||||
$XML = new DOMDocument();
|
||||
$XML->loadXML($xml);
|
||||
|
||||
$xsltemplate = new DOMDocument();
|
||||
$xsltemplate->loadXML($template->xslt_xhtml_c4);
|
||||
|
||||
|
||||
+523
-118
@@ -1,21 +1,12 @@
|
||||
<?php
|
||||
|
||||
/* Copyright (C) 2025 fhcomplete.net
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||
/**
|
||||
* FH-Complete
|
||||
*
|
||||
* @package FHC-Helper
|
||||
* @author FHC-Team
|
||||
* @copyright Copyright (c) 2022 fhcomplete.net
|
||||
* @license GPLv3
|
||||
*/
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
@@ -24,17 +15,24 @@ use \stdClass as stdClass;
|
||||
|
||||
class DmsLib
|
||||
{
|
||||
const DMS_SYS_NAME = 'DMS System';
|
||||
const FILE_CONTENT_PROPERTY = 'file_content'; // property name for file content
|
||||
|
||||
private $_ci; // code igniter instance
|
||||
private $_who; // who added this document
|
||||
|
||||
/**
|
||||
* Object initialization
|
||||
*/
|
||||
public function __construct()
|
||||
public function __construct($params = null)
|
||||
{
|
||||
$this->_ci =& get_instance();
|
||||
|
||||
// Set the the _who property
|
||||
$this->_who = 'DMS system'; // default
|
||||
// It is possible to set it using the who parameter
|
||||
if (!isEmptyArray($params) && isset($params['who']) && !isEmptyString($params['who'])) $this->_who = $params['who'];
|
||||
|
||||
$this->_ci->load->model('crm/Akte_model', 'AkteModel'); // deprecated, should not be used here!
|
||||
$this->_ci->load->model('content/Dms_model', 'DmsModel');
|
||||
$this->_ci->load->model('content/DmsVersion_model', 'DmsVersionModel');
|
||||
$this->_ci->load->model('content/DmsFS_model', 'DmsFSModel');
|
||||
@@ -48,85 +46,69 @@ class DmsLib
|
||||
* Returns success info of added dms entry (dms_id, version, filename) or error
|
||||
*/
|
||||
public function add(
|
||||
// Required parameters
|
||||
$name, $mimetype, $fileHandle,
|
||||
// Optional parameters
|
||||
$kategorie_kurzbz = null, $dokument_kurzbz = null, $beschreibung = null, $cis_suche = false, $schlagworte = null, $insertvon = self::DMS_SYS_NAME
|
||||
$name, $mimetype, $fileHandle, // Required parameters
|
||||
$kategorie_kurzbz = null, $dokument_kurzbz = null, $beschreibung = null, $cis_suche = false, $schlagworte = null
|
||||
)
|
||||
{
|
||||
// If the file handle is not valid
|
||||
if ($fileHandle === false) return error('Was not possible to open the given file');
|
||||
// create unique filename, using original document name to detect file extension
|
||||
$filename = $this->_getUniqueFilename($name);
|
||||
|
||||
// Create unique filename, using original document name to detect file extension
|
||||
$filename = $this->_getUniqueFilename($name);
|
||||
// copy file from fileHandle to dms folder
|
||||
$copyFileResult = $this->_copyFile($fileHandle, $filename);
|
||||
|
||||
// Copy file from fileHandle to dms folder
|
||||
$copyFileResult = $this->_copyFile($fileHandle, $filename);
|
||||
if (isError($copyFileResult)) return $copyFileResult;
|
||||
|
||||
// If an error occrured while copying the file
|
||||
if (isError($copyFileResult)) return $copyFileResult;
|
||||
|
||||
// Insert the new DMS
|
||||
$dmsResult = $this->_ci->DmsModel->insert(
|
||||
array(
|
||||
'kategorie_kurzbz' => $kategorie_kurzbz,
|
||||
'dokument_kurzbz' => $dokument_kurzbz
|
||||
)
|
||||
);
|
||||
|
||||
// If an error occurred
|
||||
if (isError($dmsResult)) return $dmsResult;
|
||||
|
||||
// If a DMS in the previous insert returned the new PK value
|
||||
if (hasData($dmsResult))
|
||||
{
|
||||
$dms_id = getData($dmsResult);
|
||||
|
||||
// Insert the DMS version
|
||||
$dmsVersion = array(
|
||||
'dms_id' => $dms_id,
|
||||
'version' => 0,
|
||||
'filename' => $filename,
|
||||
'mimetype' => $mimetype,
|
||||
'name' => $name,
|
||||
'beschreibung' => $beschreibung,
|
||||
'cis_suche' => $cis_suche,
|
||||
'schlagworte' => $schlagworte,
|
||||
'insertvon' => $insertvon,
|
||||
'insertamum' => date('Y-m-d H:i:s')
|
||||
// if file written successful, insert dms
|
||||
$dmsResult = $this->_ci->DmsModel->insert(
|
||||
array(
|
||||
'kategorie_kurzbz' => $kategorie_kurzbz,
|
||||
'dokument_kurzbz' => $dokument_kurzbz
|
||||
)
|
||||
);
|
||||
|
||||
$dmsVersionResult = $this->_ci->DmsVersionModel->insert($dmsVersion);
|
||||
if (isError($dmsResult)) return $dmsResult;
|
||||
|
||||
// If an error occured
|
||||
if (isError($dmsVersionResult)) return $dmsVersionResult;
|
||||
if (hasData($dmsResult))
|
||||
{
|
||||
$dms_id = getData($dmsResult);
|
||||
$version = 0;
|
||||
|
||||
// Return dms info
|
||||
$resObj = new stdClass();
|
||||
$resObj->dms_id = $dms_id;
|
||||
$resObj->version = 0;
|
||||
$resObj->filename = $filename;
|
||||
// insert dms version
|
||||
$dmsVersion = array(
|
||||
'dms_id' => $dms_id,
|
||||
'version' => $version,
|
||||
'filename' => $filename,
|
||||
'mimetype' => $mimetype,
|
||||
'name' => $name,
|
||||
'beschreibung' => $beschreibung,
|
||||
'cis_suche' => $cis_suche,
|
||||
'schlagworte' => $schlagworte,
|
||||
'insertvon' => $this->_who,
|
||||
'insertamum' => date('Y-m-d H:i:s')
|
||||
);
|
||||
|
||||
return success($resObj);
|
||||
}
|
||||
else
|
||||
return success();
|
||||
$dmsVersionResult = $this->_ci->DmsVersionModel->insert($dmsVersion);
|
||||
|
||||
if (isError($dmsVersionResult)) return $dmsVersionResult;
|
||||
|
||||
// return dms info
|
||||
$resObj = new stdClass();
|
||||
$resObj->dms_id = $dms_id;
|
||||
$resObj->version = $version;
|
||||
$resObj->filename = $filename;
|
||||
|
||||
return success($resObj);
|
||||
}
|
||||
else
|
||||
return error("error when inserting DMS");
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes a new file with content of fileHandle, adds a new dms version (max version number + 1) for the written file
|
||||
* Returns success with info of added dms version (version, filename) or error
|
||||
*/
|
||||
public function addNewVersion(
|
||||
// Required parameters
|
||||
$dms_id, $fileHandle,
|
||||
// Optional parameters
|
||||
$name = null, $mimetype = null, $beschreibung = null, $cis_suche = false, $schlagworte = null, $insertvon = self::DMS_SYS_NAME
|
||||
)
|
||||
public function addNewVersion($dms_id, $fileHandle, $name = null, $mimetype = null, $beschreibung = null, $cis_suche = false, $schlagworte = null)
|
||||
{
|
||||
// If the file handle is not valid
|
||||
if ($fileHandle === false) return error('Was not possible to open the given file');
|
||||
|
||||
// get the latest version
|
||||
$lastVersionResult = $this->getLastVersion($dms_id);
|
||||
|
||||
@@ -159,7 +141,7 @@ class DmsLib
|
||||
'beschreibung' => isset($beschreibung) ? $beschreibung : $lastVersion->beschreibung,
|
||||
'cis_suche' => isset($cis_suche) ? $cis_suche : $lastVersion->cis_suche,
|
||||
'schlagworte' => isset($schlagworte) ? $schlagworte : $lastVersion->schlagworte,
|
||||
'insertvon' => $insertvon,
|
||||
'insertvon' => $this->_who,
|
||||
'insertamum' => date('Y-m-d H:i:s')
|
||||
);
|
||||
|
||||
@@ -175,7 +157,7 @@ class DmsLib
|
||||
return success($resObj);
|
||||
}
|
||||
else
|
||||
return success();
|
||||
return error("last version not found");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -185,9 +167,6 @@ class DmsLib
|
||||
*/
|
||||
public function updateLastVersion($dms_id, $fileHandle, $name = null, $mimetype = null, $beschreibung = null, $cis_suche = false, $schlagworte = null)
|
||||
{
|
||||
// If the file handle is not valid
|
||||
if ($fileHandle === false) return error('Was not possible to open the given file');
|
||||
|
||||
// get the latest version
|
||||
$lastVersionResult = $this->getLastVersion($dms_id);
|
||||
|
||||
@@ -229,12 +208,12 @@ class DmsLib
|
||||
return success($resObj);
|
||||
}
|
||||
else
|
||||
return success();
|
||||
return error("last version not found");
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets dms version with highest number
|
||||
* Returns success with dms data or error
|
||||
* Returns success with dms data and fileHandle with file content or error
|
||||
*/
|
||||
public function getLastVersion($dms_id)
|
||||
{
|
||||
@@ -258,12 +237,12 @@ class DmsLib
|
||||
return $this->getVersion($dms_id, $lastDmsVersion);
|
||||
}
|
||||
else
|
||||
return success();
|
||||
return error("Dms last version not found");
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets specified dms version
|
||||
* Returns success with dms data or error
|
||||
* Returns success with dms data and fileHandle with file content or error
|
||||
*/
|
||||
public function getVersion($dms_id, $version)
|
||||
{
|
||||
@@ -275,7 +254,34 @@ class DmsLib
|
||||
)
|
||||
);
|
||||
|
||||
return $dmsVersionResult;
|
||||
if (isError($dmsVersionResult)) return $dmsVersionResult;
|
||||
|
||||
if (hasData($dmsVersionResult))
|
||||
{
|
||||
$dmsVersion = getData($dmsVersionResult)[0];
|
||||
|
||||
// get file content as file pointer
|
||||
$fileHandleResult = $this->_ci->DmsFSModel->openRead($dmsVersion->filename);
|
||||
|
||||
if (isError($fileHandleResult)) return $fileHandleResult;
|
||||
|
||||
if (hasData($fileHandleResult))
|
||||
{
|
||||
$fileHandle = getData($fileHandleResult);
|
||||
$dmsVersion->{self::FILE_CONTENT_PROPERTY} = $fileHandle;
|
||||
|
||||
// close file pointer
|
||||
$closeResult = $this->_ci->DmsFSModel->close($fileHandle);
|
||||
|
||||
if (isError($closeResult)) return $closeResult;
|
||||
|
||||
return success($dmsVersion);
|
||||
}
|
||||
else
|
||||
return error("File could not be opened");
|
||||
}
|
||||
else
|
||||
return error("Dms version not found");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -414,34 +420,6 @@ class DmsLib
|
||||
return success($removeVersionResultObj);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get info from the DMS to be provided to the FHC_Controller->outputFile
|
||||
*/
|
||||
public function getOutputFileInfo($dms_id, $file_name = '', $disposition = 'attachment')
|
||||
{
|
||||
// Loads the last DMS version from database
|
||||
$lastVersionResult = $this->getLastVersion($dms_id);
|
||||
|
||||
// If an error occurred then return it
|
||||
if (isError($lastVersionResult)) return $lastVersionResult;
|
||||
|
||||
// If has been found
|
||||
if (hasData($lastVersionResult))
|
||||
{
|
||||
$lastVersion = getData($lastVersionResult)[0];
|
||||
|
||||
$fileObj = new stdClass();
|
||||
$fileObj->file = DMS_PATH.$lastVersion->filename;
|
||||
$fileObj->name = isEmptyString($file_name) ? $lastVersion->name : $file_name;
|
||||
$fileObj->mimetype = $lastVersion->mimetype;
|
||||
$fileObj->disposition = $disposition;
|
||||
|
||||
return success($fileObj);
|
||||
}
|
||||
|
||||
return success();
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------
|
||||
// Private methods
|
||||
|
||||
@@ -496,5 +474,432 @@ class DmsLib
|
||||
|
||||
return $uniqueFilename;
|
||||
}
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------
|
||||
// Deprecated methods, not to be used
|
||||
|
||||
/**
|
||||
* Load a DMS Document.
|
||||
* If no version is particularly given, the latest version is loaded.
|
||||
*
|
||||
* @param $dms_id
|
||||
* @param integer $version
|
||||
* @return array
|
||||
*/
|
||||
public function load($dms_id, $version = null)
|
||||
{
|
||||
if (is_numeric($dms_id))
|
||||
{
|
||||
$this->_ci->DmsModel->addJoin('campus.tbl_dms_version', 'dms_id');
|
||||
$this->_ci->DmsModel->addOrder('version', 'DESC');
|
||||
$this->_ci->DmsModel->addLimit(1);
|
||||
|
||||
if (!is_numeric($version))
|
||||
{
|
||||
return $this->_ci->DmsModel->load($dms_id);
|
||||
}
|
||||
else
|
||||
{
|
||||
return $this->_ci->DmsModel->loadWhere(array('dms_id' => $dms_id, 'version' => $version));
|
||||
}
|
||||
}
|
||||
|
||||
return error('The parameter DMS ID must be a number');
|
||||
}
|
||||
|
||||
/**
|
||||
* Read a DMS Document from the Filesystem
|
||||
* @param int $dms_id ID of the Document.
|
||||
* @param int $version The version of the Document (latest if null).
|
||||
* @return object success or error
|
||||
*/
|
||||
public function read($dms_id, $version = null)
|
||||
{
|
||||
$result = error('Wrong dms_id parameter');
|
||||
|
||||
if (isset($dms_id))
|
||||
{
|
||||
$this->_ci->DmsModel->addJoin('campus.tbl_dms_version', 'dms_id');
|
||||
$this->_ci->DmsModel->addOrder('version', 'DESC');
|
||||
$this->_ci->DmsModel->addLimit(1);
|
||||
|
||||
if (!isset($version))
|
||||
{
|
||||
$result = $this->_ci->DmsModel->load($dms_id);
|
||||
}
|
||||
else
|
||||
{
|
||||
$result = $this->_ci->DmsModel->loadWhere(array('dms_id' => $dms_id, 'version' => $version));
|
||||
}
|
||||
|
||||
// If a dms has been found
|
||||
if (hasData($result))
|
||||
{
|
||||
$resultFS = $this->_ci->DmsFSModel->readBase64(getData($result)[0]->filename);
|
||||
if (isError($resultFS)) return $resultFS; // if an error occurred return it
|
||||
|
||||
$result->retval[0]->{self::FILE_CONTENT_PROPERTY} = getData($resultFS);
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all accepted Documents of a Person
|
||||
*
|
||||
* @param int $person_id ID of the person.
|
||||
* @param string $dokument_kurzbz Type of document.
|
||||
* @param bool $no_file If null then loads also the content.
|
||||
* @return object success or error
|
||||
*/
|
||||
public function getAktenAcceptedDms($person_id, $dokument_kurzbz = null, $no_file = null)
|
||||
{
|
||||
$result = $this->_ci->AkteModel->getAktenAcceptedDms($person_id, $dokument_kurzbz);
|
||||
|
||||
if (hasData($result) && $no_file == null)
|
||||
{
|
||||
for ($i = 0; $i < count(getData($result)); $i++)
|
||||
{
|
||||
$resultFS = $this->_ci->DmsFSModel->readBase64(getData($result)[$i]->filename);
|
||||
if (isError($resultFS)) return $resultFS; // if an error occurred return it
|
||||
|
||||
$result->retval[$i]->{self::FILE_CONTENT_PROPERTY} = getData($resultFS);
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Uploads a document and saves it to DMS
|
||||
* @param $dms DMS assoc array
|
||||
* @param $field_name Name of the HTML uploadfile input name attribute
|
||||
* @param array $allowed_types Default: all. Param example: array(jpg, pdf)
|
||||
* @return array
|
||||
*/
|
||||
public function upload($dms, $field_name, $allowed_types = array('*'))
|
||||
{
|
||||
// Init upload configs
|
||||
$this->_loadUploadLibrary($allowed_types);
|
||||
|
||||
if (!$this->_ci->upload->do_upload($field_name))
|
||||
{
|
||||
return error($this->_ci->upload->display_errors());
|
||||
}
|
||||
|
||||
$upload_data = $this->_ci->upload->data(); // data about the uploaded file
|
||||
|
||||
// Insert to DMS table
|
||||
$insDmsResult = $this->_ci->DmsModel->insert($this->_ci->DmsModel->filterFields($dms));
|
||||
if (isError($insDmsResult)) return $insDmsResult;
|
||||
|
||||
$upload_data['dms_id'] = getData($insDmsResult);
|
||||
if(isset($upload_data['file_type']) && !isset($dms['mimetype']))
|
||||
$dms['mimetype'] = $upload_data['file_type'];
|
||||
|
||||
// Insert DMS version
|
||||
$insVersionResult = $this->_ci->DmsVersionModel->insert(
|
||||
$this->_ci->DmsVersionModel->filterFields(
|
||||
$dms,
|
||||
$upload_data['dms_id'],
|
||||
$upload_data['file_name']
|
||||
)
|
||||
);
|
||||
if (isError($insVersionResult)) return $insVersionResult;
|
||||
|
||||
// Return result of uploaded data
|
||||
return success($upload_data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Download a document.
|
||||
*
|
||||
* @param $dms_id
|
||||
* @param string $filename $filename If String is given, it will be used as filename on download
|
||||
* @param string $disposition [inline | attachment]
|
||||
* Inline opens doc in new tab. Attachment displays download dialog box.
|
||||
*/
|
||||
public function download($dms_id, $filename = null, $disposition = 'inline')
|
||||
{
|
||||
// Retrieves info about the given dms
|
||||
$fileInfoResult = $this->getFileInfo($dms_id);
|
||||
if (isError($fileInfoResult)) return error(getError($fileInfoResult));
|
||||
|
||||
// If data have been found
|
||||
if (hasData($fileInfoResult))
|
||||
{
|
||||
$fileObj = getData($fileInfoResult);
|
||||
|
||||
// Change filename, if filename is provided
|
||||
if (!isEmptyString($filename)) $fileObj->name = $filename;
|
||||
|
||||
// Add file disposition if disposition has a valid value
|
||||
if ($disposition == 'attachment' || $disposition == 'inline')
|
||||
{
|
||||
$fileObj->disposition = $disposition;
|
||||
}
|
||||
|
||||
return success($fileObj);
|
||||
}
|
||||
|
||||
// If no data have been found then return an empty success
|
||||
return success();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get file information.
|
||||
*
|
||||
* @param $dms_id
|
||||
* @param integer $version
|
||||
* @return array with File Object.
|
||||
*/
|
||||
public function getFileInfo($dms_id, $version = null)
|
||||
{
|
||||
// Checks the dms_id parameter
|
||||
if (!is_numeric($dms_id)) return error('Wrong parameter');
|
||||
|
||||
// Load DMS from database
|
||||
$result = $this->load($dms_id, $version);
|
||||
if (isError($result)) return error(getError($result));
|
||||
|
||||
// If data have been found
|
||||
if (hasData($result))
|
||||
{
|
||||
// Store file information in fileObj
|
||||
$fileObj = new stdClass();
|
||||
$fileObj->filename = getData($result)[0]->filename;
|
||||
$fileObj->file = DMS_PATH.getData($result)[0]->filename;
|
||||
$fileObj->name = getData($result)[0]->name; // original user filename
|
||||
$fileObj->mimetype = getData($result)[0]->mimetype;
|
||||
|
||||
return success($fileObj);
|
||||
}
|
||||
|
||||
// If no data have been found return an empty success
|
||||
return success();
|
||||
}
|
||||
|
||||
/**
|
||||
* Saves a Document
|
||||
* @param object $dms DMS Object ot be saved.
|
||||
* @return object
|
||||
*/
|
||||
public function save($dms)
|
||||
{
|
||||
$result = null;
|
||||
|
||||
if (isset($dms['new']) && $dms['new'] == true)
|
||||
{
|
||||
// Remove new parameter to avoid DB insert errors
|
||||
unset($dms['new']);
|
||||
|
||||
$result = $this->_saveFileOnInsert($dms);
|
||||
if (isSuccess($result))
|
||||
{
|
||||
$filename = getData($result);
|
||||
if (isset($dms['dms_id']) && $dms['dms_id'] != '')
|
||||
{
|
||||
$result = $this->_ci->DmsVersionModel->insert(
|
||||
$this->_ci->DmsVersionModel->filterFields($dms, $dms['dms_id'], $filename)
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
$result = $this->_ci->DmsModel->insert($this->_ci->DmsModel->filterFields($dms));
|
||||
if (isSuccess($result))
|
||||
{
|
||||
$result = $this->_ci->DmsVersionModel->insert(
|
||||
$this->_ci->DmsVersionModel->filterFields($dms, getData($result), $filename)
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$result = $this->_saveFileOnUpdate($dms);
|
||||
if (isSuccess($result))
|
||||
{
|
||||
$result = $this->_ci->DmsModel->update($dms['dms_id'], $this->_ci->DmsModel->filterFields($dms));
|
||||
if (isSuccess($result))
|
||||
{
|
||||
$result = $this->_ci->DmsVersionModel->update(
|
||||
array(
|
||||
$dms['dms_id'],
|
||||
$dms['version']
|
||||
),
|
||||
$this->_ci->DmsVersionModel->filterFields($dms)
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes a Akte of a Person
|
||||
* @param int $person_id ID of the person.
|
||||
* @param int $dms_id Id of the Document.
|
||||
* @return object
|
||||
*/
|
||||
public function delete($person_id, $dms_id)
|
||||
{
|
||||
$result = null;
|
||||
|
||||
// If the parameters are valid
|
||||
if (is_numeric($person_id) && is_numeric($dms_id))
|
||||
{
|
||||
// Start DB transaction
|
||||
$this->_ci->db->trans_start(false);
|
||||
|
||||
// Get akte_id from table tbl_akte
|
||||
$result = $this->_ci->AkteModel->loadWhere(array('person_id' => $person_id, 'dms_id' => $dms_id));
|
||||
if (isSuccess($result))
|
||||
{
|
||||
// Delete all entries in tbl_akte
|
||||
for ($i = 0; $i < count(getData($result)); $i++)
|
||||
{
|
||||
$this->_ci->AkteModel->delete(getData($result)[$i]->akte_id);
|
||||
}
|
||||
|
||||
// Get all filenames related to this dms
|
||||
$resultFileNames = $this->_ci->DmsVersionModel->loadWhere(array('dms_id' => $dms_id));
|
||||
if (isSuccess($resultFileNames))
|
||||
{
|
||||
// Delete from tbl_dms_version
|
||||
$result = $this->_ci->DmsVersionModel->delete(array('dms_id' => $dms_id));
|
||||
if (isSuccess($result))
|
||||
{
|
||||
// Delete from tbl_dms
|
||||
$result = $this->_ci->DmsModel->delete($dms_id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Transaction complete!
|
||||
$this->_ci->db->trans_complete();
|
||||
|
||||
// Check if everything went ok during the transaction
|
||||
if ($this->_ci->db->trans_status() === false || isError($result))
|
||||
{
|
||||
$this->_ci->db->trans_rollback();
|
||||
$result = error('An error occurred while performing a delete operation', EXIT_ERROR);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->_ci->db->trans_commit();
|
||||
$result = success('Dms successfully removed from DB');
|
||||
}
|
||||
|
||||
// If everything is ok
|
||||
if (isSuccess($result))
|
||||
{
|
||||
// Remove all files related to this person and dms
|
||||
for ($i = 0; $i < count(getData($resultFileNames)); $i++)
|
||||
{
|
||||
$this->_ci->DmsFSModel->removeBase64(getData($resultFileNames)[$i]->filename);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$result = error('Invalid parameters');
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads the Content of an akte
|
||||
* @param int $akte_id Id of the akte.
|
||||
* @return object with document content or error
|
||||
*/
|
||||
public function getAkteContent($akte_id)
|
||||
{
|
||||
$akte = $this->_ci->AkteModel->load($akte_id);
|
||||
if (hasData($akte))
|
||||
{
|
||||
if (getData($akte)[0]->inhalt != '')
|
||||
{
|
||||
return success(base64_decode(getData($akte)[0]->inhalt));
|
||||
}
|
||||
elseif (getData($akte)[0]->dms_id != '')
|
||||
{
|
||||
$dmscontent = $this->read(getData($akte)[0]->dms_id);
|
||||
if (isSuccess($dmscontent))
|
||||
{
|
||||
return success(base64_decode(getData($dmscontent)[0]->file_content));
|
||||
}
|
||||
else
|
||||
{
|
||||
return error(getError($dmscontent));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return error('No Content available');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return error(getError($akte));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Saves the Content of a DMS in the Filesystem
|
||||
* @param object $dms DMS object to be saved.
|
||||
* @return object
|
||||
*/
|
||||
private function _saveFileOnInsert($dms)
|
||||
{
|
||||
$filename = uniqid().'.'.pathinfo($dms['name'], PATHINFO_EXTENSION);
|
||||
|
||||
$result = $this->_ci->DmsFSModel->writeBase64($filename, $dms['file_content']);
|
||||
if (isSuccess($result))
|
||||
{
|
||||
$result = success($filename);
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates the File in the Filesystem
|
||||
* @param object $dms DMS object to update.
|
||||
* @return object
|
||||
*/
|
||||
private function _saveFileOnUpdate($dms)
|
||||
{
|
||||
$result = null;
|
||||
|
||||
if (isset($dms['version']))
|
||||
{
|
||||
$result = $this->read($dms['dms_id'], $dms['version']);
|
||||
|
||||
if (hasData($result))
|
||||
{
|
||||
$result = $this->_ci->DmsFSModel->writeBase64(getData($result)[0]->filename, $dms['file_content']);
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads the upload library of CI
|
||||
*/
|
||||
private function _loadUploadLibrary($allowed_types)
|
||||
{
|
||||
$config = array();
|
||||
$config['upload_path'] = DMS_PATH;
|
||||
$config['allowed_types'] = implode('|', $allowed_types);
|
||||
$config['overwrite'] = true;
|
||||
$config['file_name'] = uniqid().'.pdf';
|
||||
|
||||
$this->_ci->load->library('upload', $config);
|
||||
$this->_ci->upload->initialize($config);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
/* Copyright (C) 2025 fhcomplete.net
|
||||
/* Copyright (C) 2024 fhcomplete.net
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as
|
||||
@@ -34,11 +34,15 @@ use SimpleXMLElement as SimpleXMLElement;
|
||||
* modifiing said data (sign()/setXMLTag_archivierbar()) or adding
|
||||
* images (addImage()) and then call output() and close().
|
||||
* Now the create, output and close functions are combined into one function and adding data and images is done via parameters.
|
||||
* There are now two functions getContent() and showContent() where showContent() equals to output(false) and getContent equals to output(true)
|
||||
* Instead of calling addDataArray, addDataXML or addDataURL just call
|
||||
* getDataArray, getDataXML or getDataURL respectevily and use the return
|
||||
* value as $xml_data parameter in the getContent call.
|
||||
* value as $xml_data parameter in the showContent and getContent calls.
|
||||
* Instead of calling addImages just create an array and pass it as $images
|
||||
* parameter to the getContent function.
|
||||
* parameter to the showContent/getContent function.
|
||||
* The old setFilename() function is now a parameter in showContent(). It is
|
||||
* not needed in getContent() since that function does not do anything that
|
||||
* requires a filename.
|
||||
* To get/show a signed document just pass a valid uid as $sign_user
|
||||
* parameter.
|
||||
*
|
||||
@@ -59,10 +63,21 @@ use SimpleXMLElement as SimpleXMLElement;
|
||||
* 'name' => $imagename,
|
||||
* 'contenttype' => $imagecontenttype
|
||||
* ]];
|
||||
* $this->documentexportlib->showContent(
|
||||
* $filename,
|
||||
* $vorlage,
|
||||
* $xml_data,
|
||||
* $oe_kurzbz,
|
||||
* $version,
|
||||
* $outputformat,
|
||||
* null,
|
||||
* null,
|
||||
* $images
|
||||
* );
|
||||
*/
|
||||
class DocumentExportLib
|
||||
{
|
||||
private $_ci;
|
||||
private $unoconv_version;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
@@ -70,14 +85,33 @@ class DocumentExportLib
|
||||
public function __construct()
|
||||
{
|
||||
// Gets CI instance
|
||||
$this->_ci =& get_instance();
|
||||
$this->ci =& get_instance();
|
||||
|
||||
// Load phrases
|
||||
$this->_ci->load->library('PhrasesLib', ['document_export', null], 'DocumentExportPhrases');
|
||||
// Load Phrases
|
||||
$this->ci->load->library('PhrasesLib', ['document_export', null], 'documentExportPhrases');
|
||||
|
||||
// Load libraries
|
||||
$this->_ci->load->library('DocumentLib');
|
||||
$this->_ci->load->library('SignatureLib');
|
||||
// Which document converter has to be used
|
||||
if (defined('DOCSBOX_ENABLED') && DOCSBOX_ENABLED === true)
|
||||
{
|
||||
// Use docsbox!!
|
||||
}
|
||||
else
|
||||
{
|
||||
exec('unoconv --version', $ret_arr);
|
||||
|
||||
if(isset($ret_arr[0]))
|
||||
{
|
||||
$hlp = explode(' ', $ret_arr[0]);
|
||||
if(isset($hlp[1]))
|
||||
{
|
||||
$this->unoconv_version = $hlp[1];
|
||||
}
|
||||
else
|
||||
show_error($this->ci->documentExportPhrases->t("document_export", "error_unoconv_version"));
|
||||
}
|
||||
else
|
||||
show_error($this->ci->documentExportPhrases->t("document_export", "error_unoconv"));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -138,7 +172,7 @@ class DocumentExportLib
|
||||
$xml_data = new DOMDocument;
|
||||
|
||||
if (!$xml_data->load($xml_url))
|
||||
return error($this->_ci->DocumentExportPhrases->t("document_export", "error_xml_load", [
|
||||
return error($this->ci->documentExportPhrases->t("document_export", "error_xml_load", [
|
||||
"url" => $xml_url,
|
||||
"xml" => $xml,
|
||||
"params" => $params
|
||||
@@ -202,7 +236,7 @@ class DocumentExportLib
|
||||
|
||||
$outputformat = $this->getDefaultOutputFormat($outputformat, $vorlage->mimetype);
|
||||
|
||||
$createResult = $this->createAndSignContent(
|
||||
$result = $this->createAndSignContent(
|
||||
$temp_folder,
|
||||
$outputformat,
|
||||
$vorlage,
|
||||
@@ -213,26 +247,118 @@ class DocumentExportLib
|
||||
$sign_user,
|
||||
$sign_profile
|
||||
);
|
||||
if (isError($createResult)) {
|
||||
if (isError($result)) {
|
||||
$this->close($temp_folder, $source_folder);
|
||||
return $createResult;
|
||||
return $result;
|
||||
}
|
||||
$temp_filename = getData($createResult);
|
||||
$temp_filename = getData($result);
|
||||
|
||||
$fsize = filesize($temp_filename);
|
||||
$handle = fopen($temp_filename, 'r');
|
||||
if (!$handle)
|
||||
return error($this->_ci->DocumentExportPhrases->t("document_export", "error_file_load"));
|
||||
$fileContentResult = fread($handle, $fsize);
|
||||
return error($this->ci->documentExportPhrases->t("document_export", "error_file_load"));
|
||||
$result = fread($handle, $fsize);
|
||||
fclose($handle);
|
||||
|
||||
$this->close($temp_folder, $source_folder);
|
||||
|
||||
return success($fileContentResult);
|
||||
return success($result);
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper function for getContent
|
||||
* Sets the headers and displays the Document.
|
||||
* On failure the exit() function will be called
|
||||
*
|
||||
* @param string $filename
|
||||
* @param stdClass $vorlage A db entry from tbl_vorlage
|
||||
* @param DomDocument $xml_data
|
||||
* @param string $oe_kurzbz
|
||||
* @param integer|null $version (optional)
|
||||
* @param string $outputformat (optional)
|
||||
* @param string $sign_user (optional) Must be a valid uid
|
||||
* @param string $sign_profile (optional) Signatureprofile for signing
|
||||
* @param array $images (optional) Each element should have a property path, name & contenttype which are all strings
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function showContent(
|
||||
$filename,
|
||||
$vorlage,
|
||||
$xml_data,
|
||||
$oe_kurzbz,
|
||||
$version = null,
|
||||
$outputformat = null,
|
||||
$sign_user = null,
|
||||
$sign_profile = null,
|
||||
$images = []
|
||||
) {
|
||||
$source_folder = getcwd();
|
||||
$temp_folder = sys_get_temp_dir() . '/fhcunoconv-' . uniqid();
|
||||
|
||||
$outputformat = $this->getDefaultOutputFormat($outputformat, $vorlage->mimetype);
|
||||
|
||||
$result = $this->createAndSignContent(
|
||||
$temp_folder,
|
||||
$outputformat,
|
||||
$vorlage,
|
||||
$oe_kurzbz,
|
||||
$version,
|
||||
$xml_data,
|
||||
$images,
|
||||
$sign_user,
|
||||
$sign_profile
|
||||
);
|
||||
if (isError($result)) {
|
||||
$this->close($temp_folder, $source_folder);
|
||||
exit(getError($result));
|
||||
}
|
||||
$temp_filename = getData($result);
|
||||
|
||||
$fsize = filesize($temp_filename);
|
||||
$handle = fopen($temp_filename, 'r');
|
||||
if (!$handle) {
|
||||
$this->close($temp_folder, $source_folder);
|
||||
exit($this->ci->documentExportPhrases->t("document_export", "error_file_load"));
|
||||
}
|
||||
|
||||
if (headers_sent()) {
|
||||
$this->close($temp_folder, $source_folder);
|
||||
exit($this->ci->documentExportPhrases->t("document_export", "error_headers"));
|
||||
}
|
||||
|
||||
switch ($outputformat) {
|
||||
case 'pdf':
|
||||
header('Content-type: application/pdf');
|
||||
header('Content-Disposition: attachment; filename="' . $filename . '.pdf"');
|
||||
header('Content-Length: ' . $fsize);
|
||||
break;
|
||||
|
||||
case 'doc':
|
||||
header('Content-type: application/vnd.ms-word');
|
||||
header('Content-Disposition: attachment; filename="' . $filename . '.doc"');
|
||||
header('Content-Length: ' . $fsize);
|
||||
break;
|
||||
|
||||
case 'odt':
|
||||
header('Content-type: application/vnd.oasis.opendocument.text');
|
||||
header('Content-Disposition: attachment; filename="' . $filename . '.odt"');
|
||||
header('Content-Length: ' . $fsize);
|
||||
break;
|
||||
default:
|
||||
$this->close($temp_folder, $source_folder);
|
||||
exit($this->ci->documentExportPhrases->t("document_export", "error_outputformat_missing"));
|
||||
}
|
||||
|
||||
while (!feof($handle)) {
|
||||
echo fread($handle, 8192);
|
||||
}
|
||||
fclose($handle);
|
||||
|
||||
$this->close($temp_folder, $source_folder);
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper function for getContent and showContent.
|
||||
* Creates the temp folder and calls create and sign functions.
|
||||
*
|
||||
* @param string $temp_folder
|
||||
@@ -261,13 +387,13 @@ class DocumentExportLib
|
||||
mkdir($temp_folder);
|
||||
chdir($temp_folder);
|
||||
|
||||
$this->_ci->load->model('system/Vorlagestudiengang_model', 'VorlagestudiengangModel');
|
||||
$this->ci->load->model('system/Vorlagestudiengang_model', 'VorlagestudiengangModel');
|
||||
|
||||
$result = $this->_ci->VorlagestudiengangModel->getCurrent($vorlage->vorlage_kurzbz, $oe_kurzbz, $version);
|
||||
$result = $this->ci->VorlagestudiengangModel->getCurrent($vorlage->vorlage_kurzbz, $oe_kurzbz, $version);
|
||||
if (isError($result))
|
||||
return $result;
|
||||
if (!hasData($result))
|
||||
return error($this->_ci->DocumentExportPhrases->t("document_export", "error_template_missing"));
|
||||
return error($this->ci->documentExportPhrases->t("document_export", "error_template_missing"));
|
||||
$vorlage_stg = current(getData($result));
|
||||
foreach ($vorlage_stg as $k => $v)
|
||||
$vorlage->$k = $v;
|
||||
@@ -311,7 +437,7 @@ class DocumentExportLib
|
||||
{
|
||||
$content_xsl = new DOMDocument();
|
||||
if (!$content_xsl->loadXML($vorlage->text))
|
||||
return error($this->_ci->DocumentExportPhrases->t("document_export", "error_xsl_load"));
|
||||
return error($this->ci->documentExportPhrases->t("document_export", "error_xsl_load"));
|
||||
|
||||
$proc = new XSLTProcessor();
|
||||
$proc->importStyleSheet($content_xsl);
|
||||
@@ -328,7 +454,7 @@ class DocumentExportLib
|
||||
if ($vorlage->style) {
|
||||
$styles_xsl = new DOMDocument();
|
||||
if (!$styles_xsl->loadXML($vorlage->style))
|
||||
return error($this->_ci->DocumentExportPhrases->t("document_export", "error_styles_load"));
|
||||
return error($this->ci->documentExportPhrases->t("document_export", "error_styles_load"));
|
||||
$style_proc = new XSLTProcessor();
|
||||
$style_proc->importStyleSheet($styles_xsl);
|
||||
|
||||
@@ -356,7 +482,7 @@ class DocumentExportLib
|
||||
$tempname_zip = $temp_folder . '/out.zip';
|
||||
|
||||
if (!copy($zipfile, $tempname_zip))
|
||||
return error($this->_ci->DocumentExportPhrases->t("document_export", "error_file_copy"));
|
||||
return error($this->ci->documentExportPhrases->t("document_export", "error_file_copy"));
|
||||
|
||||
exec("zip $tempname_zip content.xml");
|
||||
if (!is_null($styles_xsl))
|
||||
@@ -376,7 +502,7 @@ class DocumentExportLib
|
||||
|
||||
$manifest_xml = new DOMDocument;
|
||||
if (!$manifest_xml->loadXML($manifest))
|
||||
return error($this->_ci->DocumentExportPhrases->t("document_export", "error_manifest"));
|
||||
return error($this->ci->documentExportPhrases->t("document_export", "error_manifest"));
|
||||
|
||||
//root-node holen
|
||||
$root = $manifest_xml->getElementsByTagName('manifest')->item(0);
|
||||
@@ -403,16 +529,42 @@ class DocumentExportLib
|
||||
|
||||
clearstatcache();
|
||||
|
||||
$temp_filename = $temp_folder . '/out.' . $outputformat;
|
||||
switch ($outputformat) {
|
||||
case 'pdf':
|
||||
case 'doc':
|
||||
$converResult = $this->_ci->documentlib->convert($tempname_zip, $temp_filename, $outputformat);
|
||||
$ret = 0;
|
||||
$temp_filename = $temp_folder . '/out.' . $outputformat;
|
||||
|
||||
if (isError($converResult))
|
||||
return error($this->_ci->DocumentExportPhrases->t('document_export', 'error_conv_timeout'));
|
||||
if (defined('DOCSBOX_ENABLED') && DOCSBOX_ENABLED === true) {
|
||||
// Use docsbox
|
||||
|
||||
$this->ci->load->library("DocsboxLib");
|
||||
|
||||
$docboxlib = get_class($this->ci->docboxlib);
|
||||
|
||||
$ret = $docboxlib::convert($tempname_zip, $temp_filename, $outputformat);
|
||||
} else {
|
||||
// Use unoconv
|
||||
|
||||
// Unoconv Version 0.6 hat eine Bug wodurch die Berechtigungen des PDF/Doc nicht korrekt gesetzt
|
||||
// werden. Deshalb wird dies hier speziell behandelt.
|
||||
// Die 2. Variante hat den Vorteil dass hier eine bessere Fehlerbehandlung moeglich ist
|
||||
if ($this->unoconv_version == '0.6')
|
||||
$command = 'unoconv -e IsSkipEmptyPages=false -f ' . $outputformat . ' %2$s > %1$s';
|
||||
else
|
||||
$command = 'unoconv -e IsSkipEmptyPages=false -f ' . $outputformat . ' --output %s %s 2>&1';
|
||||
|
||||
$command = sprintf($command, $temp_filename, $tempname_zip);
|
||||
|
||||
exec($command, $out, $ret);
|
||||
}
|
||||
|
||||
if ($ret)
|
||||
return error($this->ci->documentExportPhrases->t("document_export", "error_conv_timeout"));
|
||||
break;
|
||||
case 'odt':
|
||||
default:
|
||||
$temp_filename = $tempname_zip;
|
||||
}
|
||||
|
||||
return success($temp_filename);
|
||||
@@ -432,15 +584,63 @@ class DocumentExportLib
|
||||
*/
|
||||
protected function sign($temp_folder, $temp_filename, $outputformat, $user, $profile)
|
||||
{
|
||||
if ($outputformat != 'pdf') return error($this->_ci->DocumentExportPhrases->t('document_export', 'error_sign_pdf'));
|
||||
if ($outputformat != 'pdf')
|
||||
return error($this->ci->documentExportPhrases->t("document_export", "error_sign_pdf"));
|
||||
|
||||
$signed_filename = $this->_ci->signaturelib->sign($temp_folder, $temp_filename, $user, $profile);
|
||||
// Load the File
|
||||
$file_data = file_get_contents($temp_filename);
|
||||
|
||||
// If fine then return it
|
||||
if (isSuccess($signed_filename)) return $signed_filename;
|
||||
$data = new stdClass();
|
||||
$data->document = base64_encode($file_data);
|
||||
|
||||
// Otherwise it is an error
|
||||
return error($this->_ci->DocumentExportPhrases->t('global', 'unknown_error', ['error' => getError($signed_filename)]));
|
||||
// Signatur Profil
|
||||
if (!is_null($profile))
|
||||
$data->profile = $profile;
|
||||
else
|
||||
$data->profile = SIGNATUR_DEFAULT_PROFILE;
|
||||
|
||||
// Username des Endusers der die Signatur angefordert hat
|
||||
$data->user = $user;
|
||||
|
||||
$ch = curl_init();
|
||||
|
||||
curl_setopt($ch, CURLOPT_URL, SIGNATUR_URL . '/' . SIGNATUR_SIGN_API);
|
||||
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 7);
|
||||
curl_setopt($ch, CURLOPT_USERAGENT, "FH-Complete");
|
||||
|
||||
// SSL Zertifikatsprüfung deaktivieren
|
||||
// Besser ist es das Zertifikat am Server zu installieren!
|
||||
//curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
|
||||
//curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
|
||||
|
||||
$data_string = json_encode($data, JSON_FORCE_OBJECT);
|
||||
|
||||
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
|
||||
curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt($ch, CURLOPT_HTTPHEADER, [
|
||||
'Content-Type: application/json',
|
||||
'Content-Length:' . mb_strlen($data_string),
|
||||
'Authorization: Basic ' . base64_encode(SIGNATUR_USER . ":" . SIGNATUR_PASSWORD)
|
||||
]);
|
||||
|
||||
$result = curl_exec($ch);
|
||||
if (curl_errno($ch)) {
|
||||
curl_close($ch);
|
||||
return error($this->ci->documentExportPhrases->t("document_export", "error_sign_timeout"));
|
||||
}
|
||||
curl_close($ch);
|
||||
$resultdata = json_decode($result);
|
||||
|
||||
// If it is success
|
||||
if (isset($resultdata->error) && $resultdata->error == 0) {
|
||||
$signed_filename = $temp_folder . '/signed.pdf';
|
||||
file_put_contents($signed_filename, base64_decode($resultdata->retval));
|
||||
return success($signed_filename);
|
||||
}
|
||||
|
||||
// otherwise if it is an error
|
||||
return error($resultdata->retval ?? $this->ci->documentExportPhrases->t("global", "unknown_error", ["error" => $result]));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -517,4 +717,3 @@ class DocumentExportLib
|
||||
return 'pdf';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -4,8 +4,7 @@ if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class DocumentLib
|
||||
{
|
||||
private $_ci;
|
||||
private $_unoconv_version;
|
||||
private $unoconv_version;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
@@ -13,10 +12,7 @@ class DocumentLib
|
||||
public function __construct()
|
||||
{
|
||||
// Gets CI instance
|
||||
$this->_ci =& get_instance();
|
||||
|
||||
// Load phrases
|
||||
$this->_ci->load->library('PhrasesLib', ['document_export', null], 'DocumentExportPhrases');
|
||||
$this->ci =& get_instance();
|
||||
|
||||
// Which document converter has to be used
|
||||
if (defined('DOCSBOX_ENABLED') && DOCSBOX_ENABLED === true)
|
||||
@@ -32,13 +28,13 @@ class DocumentLib
|
||||
$hlp = explode(' ', $ret_arr[0]);
|
||||
if(isset($hlp[1]))
|
||||
{
|
||||
$this->_unoconv_version = $hlp[1];
|
||||
$this->unoconv_version = $hlp[1];
|
||||
}
|
||||
else
|
||||
show_error($this->_ci->DocumentExportPhrases->t('document_export', 'error_unoconv_version'));
|
||||
show_error('Could not get Unoconv Version');
|
||||
}
|
||||
else
|
||||
show_error($this->_ci->DocumentExportPhrases->t('document_export', 'error_unoconv'));
|
||||
show_error('Unoconv not found - Please install Unoconv');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,7 +56,7 @@ class DocumentLib
|
||||
case 'image/jpeg':
|
||||
case 'image/jpg':
|
||||
case 'image/pjpeg':
|
||||
$this->_jpegToPdf($filename, $outFile);
|
||||
$this->_jpegtopdf($filename, $outFile);
|
||||
return success($outFile);
|
||||
case 'application/vnd.oasis.opendocument.spreadsheet':
|
||||
case 'application/msword':
|
||||
@@ -76,19 +72,23 @@ class DocumentLib
|
||||
else
|
||||
{
|
||||
// Unoconv Version 0.6 seems to fail on converting TXT Files
|
||||
if ($this->_unoconv_version == '0.6') return error('Unoconv Version 0.6 does not convert TXT Files correctly');
|
||||
if ($this->unoconv_version == '0.6')
|
||||
return error();
|
||||
}
|
||||
|
||||
// Convertion
|
||||
$ret = $this->convert($filename, $outFile, 'pdf');
|
||||
if(isSuccess($ret)) return success($outFile);
|
||||
|
||||
// Error
|
||||
return $ret;
|
||||
if(isSuccess($ret))
|
||||
{
|
||||
return success($outFile);
|
||||
}
|
||||
else
|
||||
{
|
||||
return error(getError($ret));
|
||||
}
|
||||
case 'application/pdf':
|
||||
return success($filename);
|
||||
default:
|
||||
return error('Unknown Mimetype:' . $mimetype);
|
||||
return error('Unknown Mimetype:'.$mimetype);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -101,20 +101,20 @@ class DocumentLib
|
||||
*/
|
||||
public function mergePDF($files, $outFile)
|
||||
{
|
||||
$cmd = 'gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=$outFile ';
|
||||
$cmd = "gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=$outFile ";
|
||||
$finfo = finfo_open(FILEINFO_MIME_TYPE);
|
||||
|
||||
// add all pdf files to the command
|
||||
foreach ($files as $f)
|
||||
{
|
||||
$cmd .= $f.' ';
|
||||
$cmd .= $f." ";
|
||||
if (!file_exists($f))
|
||||
{
|
||||
return error("File not found: '$f'");
|
||||
}
|
||||
if (finfo_file($finfo, $f) != 'application/pdf')
|
||||
if (finfo_file($finfo, $f) != "application/pdf")
|
||||
{
|
||||
return error('Wrong format('.finfo_file($finfo, $f)."): '$f'");
|
||||
return error("Wrong format(".finfo_file($finfo, $f)."): '$f'");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -144,13 +144,13 @@ class DocumentLib
|
||||
// If it is set to use docsbox
|
||||
if (defined('DOCSBOX_ENABLED') && DOCSBOX_ENABLED === true)
|
||||
{
|
||||
require_once(dirname(__FILE__).'/DocsboxLib.php');
|
||||
require_once(dirname(__FILE__).'/../application/libraries/DocsboxLib.php');
|
||||
|
||||
$ret = DocsboxLib::convert($inFile, $outFile, $format);
|
||||
}
|
||||
else // otherwise use unoconv
|
||||
{
|
||||
if ($this->_unoconv_version == '0.6')
|
||||
if ($this->unoconv_version == '0.6')
|
||||
$command = 'unoconv -f %1$s %3$s > %2$s';
|
||||
else
|
||||
$command = 'unoconv -f %s --output %s %s 2>&1';
|
||||
@@ -175,7 +175,7 @@ class DocumentLib
|
||||
* @param string $outfile Path to Output (pdf) File.
|
||||
* @return success or error object
|
||||
*/
|
||||
private function _jpegToPdf($filename, $outfile)
|
||||
private function _jpegtopdf($filename, $outfile)
|
||||
{
|
||||
if (!file_exists($filename))
|
||||
return error('File does not exists');
|
||||
@@ -230,4 +230,3 @@ class DocumentLib
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,410 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2026 fhcomplete.org
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* The exam history of one student in one course: the order of the attempts, the attempt count
|
||||
* and the limits. This class is the only source of the examination rules. The controller and the
|
||||
* client only read the result.
|
||||
*/
|
||||
class PruefungsverlaufLib
|
||||
{
|
||||
/** The first attempt: the original assessment, which is the transcript grade itself. */
|
||||
const ROLLE_ERSTANTRITT = 'erstantritt';
|
||||
|
||||
/** Each attempt after the first one. */
|
||||
const ROLLE_PRUEFUNG = 'pruefung';
|
||||
|
||||
/** The last attempt. The examination rules require a commission for it. */
|
||||
const ROLLE_KOMMISSIONELL = 'kommissionell';
|
||||
|
||||
/** Maps an attempt number to the old exam type. Kept for backward compatibility. */
|
||||
private static $_legacyTypen = [1 => 'Termin1', 2 => 'Termin2', 3 => 'Termin3'];
|
||||
|
||||
private $_ci;
|
||||
private $_noteCache = [];
|
||||
private $_specialNotes = null;
|
||||
private $_typen = null;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->_ci =& get_instance();
|
||||
$this->_ci->load->model('education/LePruefung_model', 'LePruefungModel');
|
||||
$this->_ci->load->model('education/Note_model', 'NoteModel');
|
||||
$this->_ci->load->model('education/Pruefungstyp_model', 'PruefungstypModel');
|
||||
$this->_ci->load->config('noten');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $lvNote counts as the implicit first attempt while no exam counts
|
||||
* @param mixed $zeugnisNote a credited grade makes all exams impossible
|
||||
* @return stdClass
|
||||
*/
|
||||
public function getVerlauf($student_uid, $lv_id, $sem_kurzbz, $lvNote = null, $zeugnisNote = null)
|
||||
{
|
||||
return $this->buildVerlauf($this->getPruefungen($student_uid, $lv_id, $sem_kurzbz), $lvNote, $zeugnisNote);
|
||||
}
|
||||
|
||||
/** All exams of one student in one course, in chronological order. @return array */
|
||||
public function getPruefungen($student_uid, $lv_id, $sem_kurzbz)
|
||||
{
|
||||
$result = $this->_ci->LePruefungModel->getPruefungenByUidTypLvStudiensemester($student_uid, null, $lv_id, $sem_kurzbz);
|
||||
if (isError($result) || !hasData($result)) return [];
|
||||
|
||||
return $this->sortPruefungen(getData($result));
|
||||
}
|
||||
|
||||
/** Sort keys: datum, then tbl_pruefungstyp.sort (old rows without a date), then pruefung_id. */
|
||||
public function sortPruefungen($pruefungen)
|
||||
{
|
||||
$pruefungen = array_values($pruefungen);
|
||||
$typen = $this->getTypen();
|
||||
|
||||
usort($pruefungen, function ($a, $b) use ($typen) {
|
||||
$da = substr((string) $a->datum, 0, 10);
|
||||
$db = substr((string) $b->datum, 0, 10);
|
||||
|
||||
if ($da !== $db) {
|
||||
if ($da === '') return -1;
|
||||
if ($db === '') return 1;
|
||||
return ($da < $db) ? -1 : 1;
|
||||
}
|
||||
|
||||
$sa = isset($typen[$a->pruefungstyp_kurzbz]) ? (int) $typen[$a->pruefungstyp_kurzbz]->sort : 0;
|
||||
$sb = isset($typen[$b->pruefungstyp_kurzbz]) ? (int) $typen[$b->pruefungstyp_kurzbz]->sort : 0;
|
||||
if ($sa !== $sb) return ($sa < $sb) ? -1 : 1;
|
||||
|
||||
return ((int) $a->pruefung_id < (int) $b->pruefung_id) ? -1 : 1;
|
||||
});
|
||||
|
||||
return $pruefungen;
|
||||
}
|
||||
|
||||
/**
|
||||
* Builds the history from a list of exams. Each exam gets: position, zaehlt, antritt_nr (null
|
||||
* if the exam does not count) and terminal.
|
||||
*
|
||||
* @return stdClass
|
||||
*/
|
||||
public function buildVerlauf($pruefungen, $lvNote = null, $zeugnisNote = null)
|
||||
{
|
||||
$pruefungen = $this->sortPruefungen($pruefungen);
|
||||
|
||||
$antrittCount = 0;
|
||||
$terminal = false;
|
||||
$eintraege = [];
|
||||
|
||||
foreach ($pruefungen as $i => $p) {
|
||||
$zaehlt = $this->zaehltAlsAntritt($p->note, $p->pruefungstyp_kurzbz);
|
||||
if ($zaehlt) $antrittCount++;
|
||||
|
||||
// A kommissionelle exam closes the chain, also if its grade uses no attempt. A student
|
||||
// with a kommissionelle Prüfung gets no further exam from this tool.
|
||||
$kommissionell = $this->istKommissionell($p->pruefungstyp_kurzbz);
|
||||
if ($kommissionell) $terminal = true;
|
||||
|
||||
$eintrag = clone $p;
|
||||
$eintrag->position = $i + 1;
|
||||
$eintrag->zaehlt = $zaehlt;
|
||||
$eintrag->antritt_nr = $zaehlt ? $antrittCount : null;
|
||||
$eintrag->kommissionell = $kommissionell;
|
||||
$eintraege[] = $eintrag;
|
||||
}
|
||||
|
||||
// if no exam counts, the course grade itself is the first attempt
|
||||
$implizit = ($antrittCount === 0 && $lvNote !== null && $this->zaehltAlsAntritt($lvNote));
|
||||
if ($implizit) $antrittCount = 1;
|
||||
|
||||
$maxAntritte = $this->getMaxAntritte();
|
||||
|
||||
// credited: the row stays visible, but you cannot enter anything
|
||||
$angerechnet = $this->istAnrechnungsnote($zeugnisNote);
|
||||
|
||||
$verlauf = new stdClass();
|
||||
$verlauf->pruefungen = $eintraege;
|
||||
$verlauf->antrittCount = $antrittCount;
|
||||
$verlauf->maxAntritte = $maxAntritte;
|
||||
$verlauf->terminal = $terminal;
|
||||
$verlauf->angerechnet = $angerechnet;
|
||||
$verlauf->impliziterErstantritt = $implizit;
|
||||
$verlauf->canAdd = !$terminal && !$angerechnet && $antrittCount < $maxAntritte;
|
||||
|
||||
// after the first exam each new entry is a repeat attempt
|
||||
$verlauf->erstantrittMoeglich = !$angerechnet && (count($eintraege) === 0);
|
||||
|
||||
// The last attempt of the chain is kommissionell (§17 Abs 1). The role therefore follows
|
||||
// from the position, and the user interface offers no type to select.
|
||||
if (count($eintraege) === 0 && !$implizit) {
|
||||
$verlauf->naechsteRolle = self::ROLLE_ERSTANTRITT;
|
||||
} elseif (($antrittCount + 1) >= $maxAntritte) {
|
||||
$verlauf->naechsteRolle = self::ROLLE_KOMMISSIONELL;
|
||||
} else {
|
||||
$verlauf->naechsteRolle = self::ROLLE_PRUEFUNG;
|
||||
}
|
||||
|
||||
return $verlauf;
|
||||
}
|
||||
|
||||
/** 'angerechnet' or 'intern angerechnet'. The TRANSCRIPT grade decides. @return bool */
|
||||
public function istAnrechnungsnote($note)
|
||||
{
|
||||
if ($note === null || $note === '') return false;
|
||||
return in_array($note, $this->getSpecialNotes()['anrechnung']);
|
||||
}
|
||||
|
||||
/**
|
||||
* All attempts that count, the kommissionelle attempt included. The explicit configuration
|
||||
* wins. Without it the number comes from the old flags: the original assessment, one attempt
|
||||
* for each active repeat, and the kommissionelle attempt.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getMaxAntritte()
|
||||
{
|
||||
$max = $this->_ci->config->item('CIS_GESAMTNOTE_MAX_ANTRITTE');
|
||||
if (is_numeric($max) && (int) $max > 0) return (int) $max;
|
||||
|
||||
$max = 1;
|
||||
if (defined('CIS_GESAMTNOTE_PRUEFUNG_TERMIN2') && CIS_GESAMTNOTE_PRUEFUNG_TERMIN2) $max++;
|
||||
if (defined('CIS_GESAMTNOTE_PRUEFUNG_TERMIN3') && CIS_GESAMTNOTE_PRUEFUNG_TERMIN3) $max++;
|
||||
if (defined('CIS_GESAMTNOTE_PRUEFUNG_KOMMPRUEF') && CIS_GESAMTNOTE_PRUEFUNG_KOMMPRUEF) $max++;
|
||||
return $max;
|
||||
}
|
||||
|
||||
/**
|
||||
* The NOTE decides, therefore the same type can occur more than one time. The type decides in
|
||||
* one case only: a type in PRUEFUNG_TYPEN_OHNE_ANTRITT never uses an attempt.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function zaehltAlsAntritt($note, $typ = null)
|
||||
{
|
||||
if ($typ !== null && in_array($typ, $this->getTypenOhneAntritt())) return false;
|
||||
if ($note === null || $note === '') return false;
|
||||
if (in_array($note, $this->getSpecialNotes()['ohneAntritt'])) return false;
|
||||
|
||||
// a credited grade is not an assessment, therefore it uses no attempt
|
||||
if ($this->istAnrechnungsnote($note)) return false;
|
||||
|
||||
$noteRow = $this->getNote($note);
|
||||
return $noteRow ? (bool) $noteRow->lehre : false;
|
||||
}
|
||||
|
||||
/** Tells you if an exam takes place before a commission. @return bool */
|
||||
public function istKommissionell($typ)
|
||||
{
|
||||
$typen = $this->_ci->config->item('PRUEFUNG_KOMMISSIONELL_TYPEN');
|
||||
if (!is_array($typen)) $typen = ['kommPruef', 'zusKommPruef'];
|
||||
return in_array($typ, $typen);
|
||||
}
|
||||
|
||||
/** The exam types that never use an attempt. @return array */
|
||||
public function getTypenOhneAntritt()
|
||||
{
|
||||
$typen = $this->_ci->config->item('PRUEFUNG_TYPEN_OHNE_ANTRITT');
|
||||
return is_array($typen) ? $typen : ['zusKommPruef'];
|
||||
}
|
||||
|
||||
/**
|
||||
* The type for an attempt number. The student administration still reads this column, so the
|
||||
* value must be correct. The last attempt gets the kommissionelle type, the attempts before it
|
||||
* get the old Termin types.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function legacyTypFuerAntritt($antrittNr)
|
||||
{
|
||||
$antrittNr = max(1, (int) $antrittNr);
|
||||
$typen = $this->getTypen();
|
||||
|
||||
$maxAntritte = $this->getMaxAntritte();
|
||||
$kommissionell = $this->_ci->config->item('PRUEFUNG_TYP_KOMMISSIONELL');
|
||||
if (!is_string($kommissionell) || $kommissionell === '') $kommissionell = 'kommPruef';
|
||||
|
||||
if ($maxAntritte > 1 && $antrittNr >= $maxAntritte && isset($typen[$kommissionell])) {
|
||||
return $kommissionell;
|
||||
}
|
||||
|
||||
for ($n = $antrittNr; $n >= 1; $n--) {
|
||||
if (isset(self::$_legacyTypen[$n]) && isset($typen[self::$_legacyTypen[$n]])) {
|
||||
return self::$_legacyTypen[$n];
|
||||
}
|
||||
}
|
||||
|
||||
return self::$_legacyTypen[1];
|
||||
}
|
||||
|
||||
/**
|
||||
* The old type for a new repeat attempt. It is never lower than Termin2, also if the first
|
||||
* exam does not use an attempt.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function legacyTypFuerWiederholung($verlauf)
|
||||
{
|
||||
return $this->legacyTypFuerAntritt(max(2, $verlauf->antrittCount + 1));
|
||||
}
|
||||
|
||||
/** @return array{entschuldigt: mixed, ohneAntritt: array, anrechnung: array, limitMap: array} */
|
||||
public function getSpecialNotes()
|
||||
{
|
||||
if ($this->_specialNotes !== null) return $this->_specialNotes;
|
||||
|
||||
$cfgEntschuldigt = $this->_ci->config->item('NOTE_ENTSCHULDIGT');
|
||||
$cfgOhneAntritt = $this->_ci->config->item('NOTEN_OHNE_ANTRITT');
|
||||
$cfgLimitMap = $this->_ci->config->item('NOTEN_OCCURANCE_LIMIT_MAP');
|
||||
$bezeichnungen = $this->_ci->config->item('NOTEN_OHNE_ANTRITT_BEZEICHNUNGEN');
|
||||
if (!is_array($cfgOhneAntritt)) $cfgOhneAntritt = [];
|
||||
if (!is_array($cfgLimitMap)) $cfgLimitMap = [];
|
||||
if (!is_array($bezeichnungen)) $bezeichnungen = [];
|
||||
|
||||
$resEnt = $this->_ci->NoteModel->getEntschuldigtNote();
|
||||
$entschuldigt = (!isError($resEnt) && hasData($resEnt)) ? getData($resEnt)[0]->note : $cfgEntschuldigt;
|
||||
|
||||
// The name wins against the configured key. Do NOT merge the two sets: the same key has a
|
||||
// different meaning in each installation (17 is 'entschuldigt' here, but 'nicht zugelassen'
|
||||
// in the standard data).
|
||||
$ohneAntritt = [];
|
||||
foreach ($bezeichnungen as $bezeichnung) {
|
||||
$note = $this->getNoteByBezeichnung($bezeichnung);
|
||||
if ($note !== null && !in_array($note, $ohneAntritt)) $ohneAntritt[] = $note;
|
||||
}
|
||||
if (count($ohneAntritt) === 0) $ohneAntritt = $cfgOhneAntritt;
|
||||
if ($entschuldigt !== null && !in_array($entschuldigt, $ohneAntritt)) $ohneAntritt[] = $entschuldigt;
|
||||
|
||||
// move the configured limit for 'entschuldigt' to the key that was found
|
||||
$limitMap = [];
|
||||
foreach ($cfgLimitMap as $k => $v) {
|
||||
$limitMap[($k == $cfgEntschuldigt) ? $entschuldigt : $k] = $v;
|
||||
}
|
||||
|
||||
$this->_specialNotes = [
|
||||
'entschuldigt' => $entschuldigt,
|
||||
'ohneAntritt' => array_values($ohneAntritt),
|
||||
'anrechnung' => $this->resolveNoten('NOTEN_ANRECHNUNG_BEZEICHNUNGEN', 'NOTEN_ANRECHNUNG'),
|
||||
'limitMap' => $limitMap
|
||||
];
|
||||
return $this->_specialNotes;
|
||||
}
|
||||
|
||||
/**
|
||||
* The occurrence limit from NOTEN_OCCURANCE_LIMIT_MAP. $excludePruefungId skips the record
|
||||
* that the user edits at this moment.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function ueberschreitetNotenLimit($pruefungen, $note, $excludePruefungId = null)
|
||||
{
|
||||
$limitMap = $this->getSpecialNotes()['limitMap'];
|
||||
|
||||
$limit = null;
|
||||
foreach ($limitMap as $limitNote => $limitVal) {
|
||||
if ($limitNote == $note) { $limit = $limitVal; break; }
|
||||
}
|
||||
if ($limit === null) return false;
|
||||
|
||||
$count = 0;
|
||||
foreach ($pruefungen as $p) {
|
||||
if ($excludePruefungId !== null && $p->pruefung_id == $excludePruefungId) continue;
|
||||
if ($p->note == $note) $count++;
|
||||
}
|
||||
|
||||
return ($count + 1) > $limit;
|
||||
}
|
||||
|
||||
/** An exam with a later date locks the grade. You can still correct the date. @return bool */
|
||||
public function hatSpaeterenTermin($verlauf, $pruefung_id)
|
||||
{
|
||||
$current = null;
|
||||
foreach ($verlauf->pruefungen as $p) {
|
||||
if ($p->pruefung_id == $pruefung_id) { $current = $p; break; }
|
||||
}
|
||||
if ($current === null) return false;
|
||||
|
||||
foreach ($verlauf->pruefungen as $p) {
|
||||
if ($p->pruefung_id == $current->pruefung_id) continue;
|
||||
if ($p->position > $current->position) return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* tbl_pruefungstyp as a map. It sorts old rows, and it limits the legacy type to the types
|
||||
* that exist. A type that does not exist breaks the foreign key. Termin3 is absent from the
|
||||
* standard data.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
private function getTypen()
|
||||
{
|
||||
if ($this->_typen !== null) return $this->_typen;
|
||||
|
||||
$this->_typen = [];
|
||||
$result = $this->_ci->PruefungstypModel->load();
|
||||
if (!isError($result) && hasData($result)) {
|
||||
foreach (getData($result) as $typ) {
|
||||
$this->_typen[$typ->pruefungstyp_kurzbz] = $typ;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->_typen;
|
||||
}
|
||||
|
||||
/** Finds the grades by their name. The configured keys are the fallback only. @return array */
|
||||
private function resolveNoten($bezeichnungKey, $pkKey)
|
||||
{
|
||||
$bezeichnungen = $this->_ci->config->item($bezeichnungKey);
|
||||
if (!is_array($bezeichnungen)) $bezeichnungen = [];
|
||||
|
||||
$noten = [];
|
||||
foreach ($bezeichnungen as $bezeichnung) {
|
||||
$note = $this->getNoteByBezeichnung($bezeichnung);
|
||||
if ($note !== null && !in_array($note, $noten)) $noten[] = $note;
|
||||
}
|
||||
|
||||
if (count($noten) === 0) {
|
||||
$fallback = $this->_ci->config->item($pkKey);
|
||||
if (is_array($fallback)) $noten = $fallback;
|
||||
}
|
||||
|
||||
return array_values($noten);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return stdClass|null
|
||||
*/
|
||||
private function getNote($note)
|
||||
{
|
||||
if (array_key_exists($note, $this->_noteCache)) return $this->_noteCache[$note];
|
||||
|
||||
$result = $this->_ci->NoteModel->load($note);
|
||||
$this->_noteCache[$note] = (!isError($result) && hasData($result)) ? getData($result)[0] : null;
|
||||
return $this->_noteCache[$note];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed|null
|
||||
*/
|
||||
private function getNoteByBezeichnung($bezeichnung)
|
||||
{
|
||||
$result = $this->_ci->NoteModel->loadWhere(['bezeichnung' => $bezeichnung]);
|
||||
return (!isError($result) && hasData($result)) ? getData($result)[0]->note : null;
|
||||
}
|
||||
}
|
||||
@@ -33,7 +33,7 @@ class SearchBarLib
|
||||
const ERROR_NOT_AUTH = 'ERR005';
|
||||
|
||||
// List of allowed types of search
|
||||
const ALLOWED_TYPES = ['mitarbeiter', 'mitarbeiter_ohne_zuordnung', 'organisationunit', 'raum', 'person', 'student','studentStv', 'prestudent', 'document', 'cms'];
|
||||
const ALLOWED_TYPES = ['mitarbeiter', 'mitarbeiter_ohne_zuordnung', 'organisationunit', 'raum', 'person', 'student','studentStv', 'prestudent', 'document', 'cms', 'lehreinheit', 'lehrveranstaltung'];
|
||||
|
||||
const PHOTO_IMG_URL = '/cis/public/bild.php?src=person&person_id=';
|
||||
|
||||
@@ -180,10 +180,14 @@ class SearchBarLib
|
||||
protected function buildSearchClause(DB_Model $dbModel, array $columns, $searchstr)
|
||||
{
|
||||
$searchstr = preg_replace('/[[:punct:]]/', ' ', $searchstr);
|
||||
$words = preg_split('/\s+/', trim($searchstr), -1, PREG_SPLIT_NO_EMPTY);
|
||||
|
||||
if (empty($words)) return array();
|
||||
|
||||
$document = implode(' || \' \' || ', $columns);
|
||||
$query = '\'' . implode(':* & ', explode(' ', trim($searchstr))) . ':*\'';
|
||||
$reversequery = '\'*:' . implode(' & *:', explode(' ', trim($searchstr))) . '\'';
|
||||
$nospacequery = '\'' . implode('', explode(' ', trim($searchstr))) . ':*\'';
|
||||
$query = '\'' . implode(':* & ', $words) . ':*\'';
|
||||
$reversequery = '\'*:' . implode(' & *:', $words) . '\'';
|
||||
$nospacequery = '\'' . implode('', $words) . ':*\'';
|
||||
|
||||
$searchclause = <<<EOSC
|
||||
to_tsvector(lower(regexp_replace({$document}, '[[:punct:]]', ' ', 'g'))) @@ to_tsquery(lower({$query}))
|
||||
@@ -596,5 +600,98 @@ EOSC;
|
||||
// Otherwise return an empty array
|
||||
return array();
|
||||
}
|
||||
|
||||
|
||||
private function _lehreinheit($searchstr, $type)
|
||||
{
|
||||
$dbModel = new DB_Model();
|
||||
|
||||
$idwhere = '';
|
||||
if (ctype_digit(trim($searchstr)))
|
||||
{
|
||||
$id = (int)trim($searchstr);
|
||||
$idwhere = ' OR le.lehreinheit_id = ' . $id;
|
||||
}
|
||||
|
||||
$lehreinheit = $dbModel->execReadOnlyQuery('
|
||||
SELECT
|
||||
\'teachingunit\' AS renderer,
|
||||
\''.$type.'\' AS type,
|
||||
le.lehreinheit_id AS id,
|
||||
le.studiensemester_kurzbz,
|
||||
lv.bezeichnung,
|
||||
\'lv_table_icon icon-\' AS foto,
|
||||
UPPER(stg.typ || stg.kurzbz) AS studiengang,
|
||||
le.lehrform_kurzbz,
|
||||
lv.semester
|
||||
FROM lehre.tbl_lehreinheit le
|
||||
JOIN lehre.tbl_lehrveranstaltung lv ON (lv.lehrveranstaltung_id = le.lehrveranstaltung_id)
|
||||
JOIN public.tbl_studiengang stg ON (stg.studiengang_kz = lv.studiengang_kz)
|
||||
JOIN public.tbl_studiensemester sem ON (sem.studiensemester_kurzbz = le.studiensemester_kurzbz)
|
||||
WHERE (' .
|
||||
$this->buildSearchClause(
|
||||
$dbModel,
|
||||
array(
|
||||
'(stg.typ || stg.kurzbz)',
|
||||
'lv.semester',
|
||||
'lv.bezeichnung'
|
||||
),
|
||||
$searchstr
|
||||
) . ')' . $idwhere . '
|
||||
');
|
||||
|
||||
// If something has been found then return it
|
||||
if (hasData($lehreinheit)) return getData($lehreinheit);
|
||||
|
||||
// Otherwise return an empty array
|
||||
return array();
|
||||
}
|
||||
|
||||
private function _lehrveranstaltung($searchstr, $type)
|
||||
{
|
||||
$dbModel = new DB_Model();
|
||||
|
||||
$idwhere = '';
|
||||
|
||||
if (ctype_digit(trim($searchstr)))
|
||||
{
|
||||
$id = (int)trim($searchstr);
|
||||
$idwhere = ' OR tbl_lehrveranstaltung.lehrveranstaltung_id = ' . $id;
|
||||
}
|
||||
|
||||
$lehreinheit = $dbModel->execReadOnlyQuery('
|
||||
|
||||
SELECT
|
||||
\'teachingunit\' AS renderer,
|
||||
\''.$type.'\' AS type,
|
||||
lehrveranstaltung_id as id,
|
||||
tbl_lehrveranstaltung.bezeichnung,
|
||||
\'lv_table_icon icon-lv\' as foto,
|
||||
UPPER(tbl_studiengang.typ::varchar(1) || tbl_studiengang.kurzbz) as studiengang,
|
||||
semester,
|
||||
lehrform_kurzbz,
|
||||
tbl_organisationseinheit.bezeichnung as oe_bezeichnung
|
||||
FROM lehre.tbl_lehrveranstaltung
|
||||
JOIN public.tbl_studiengang USING(studiengang_kz)
|
||||
JOIN public.tbl_organisationseinheit ON tbl_lehrveranstaltung.oe_kurzbz = tbl_organisationseinheit.oe_kurzbz
|
||||
WHERE (' .
|
||||
$this->buildSearchClause(
|
||||
$dbModel,
|
||||
array(
|
||||
'(tbl_studiengang.typ || tbl_studiengang.kurzbz)',
|
||||
'semester',
|
||||
'tbl_lehrveranstaltung.bezeichnung'
|
||||
),
|
||||
$searchstr
|
||||
) . ')' . $idwhere . '
|
||||
');
|
||||
|
||||
// If something has been found then return it
|
||||
if (hasData($lehreinheit)) return getData($lehreinheit);
|
||||
|
||||
// Otherwise return an empty array
|
||||
return array();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -36,7 +36,15 @@ class SignatureLib
|
||||
try
|
||||
{
|
||||
// Dont send Document if it is bigger than 30 MB (Limit of Signature Server)
|
||||
if (filesize($inputFileName) > 30000000) return $this->_returnObject(1, 1, 'File too big');
|
||||
if (filesize($inputFileName) > 30000000)
|
||||
{
|
||||
$returnObject = new stdClass();
|
||||
$returnObject->code = 1;
|
||||
$returnObject->error = 1;
|
||||
$returnObject->retval = 'File to big';
|
||||
|
||||
return $returnObject;
|
||||
}
|
||||
|
||||
// Get the content of the given file
|
||||
$inputFileContent = file_get_contents($inputFileName);
|
||||
@@ -74,80 +82,4 @@ class SignatureLib
|
||||
// Otherwise return a null as error
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function sign($temp_folder, $inputFileName, $user, $profile)
|
||||
{
|
||||
// Load the File
|
||||
$file_data = file_get_contents($inputFileName);
|
||||
|
||||
$data = new stdClass();
|
||||
$data->document = base64_encode($file_data);
|
||||
|
||||
// Signatur Profil
|
||||
if (!is_null($profile))
|
||||
$data->profile = $profile;
|
||||
else
|
||||
$data->profile = SIGNATUR_DEFAULT_PROFILE;
|
||||
|
||||
// Username des Endusers der die Signatur angefordert hat
|
||||
$data->user = $user;
|
||||
|
||||
$ch = curl_init();
|
||||
|
||||
curl_setopt($ch, CURLOPT_URL, SIGNATUR_URL . '/' . SIGNATUR_SIGN_API);
|
||||
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 7);
|
||||
curl_setopt($ch, CURLOPT_USERAGENT, "FH-Complete");
|
||||
|
||||
// SSL Zertifikatsprüfung deaktivieren
|
||||
// Besser ist es das Zertifikat am Server zu installieren!
|
||||
//curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
|
||||
//curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
|
||||
|
||||
$data_string = json_encode($data, JSON_FORCE_OBJECT);
|
||||
|
||||
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
|
||||
curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt($ch, CURLOPT_HTTPHEADER, [
|
||||
'Content-Type: application/json',
|
||||
'Content-Length:' . mb_strlen($data_string),
|
||||
'Authorization: Basic ' . base64_encode(SIGNATUR_USER . ':' . SIGNATUR_PASSWORD)
|
||||
]);
|
||||
|
||||
$result = curl_exec($ch);
|
||||
if (curl_errno($ch)) {
|
||||
curl_close($ch);
|
||||
return $this->_returnObject(1, 1, 'CURL error');
|
||||
}
|
||||
curl_close($ch);
|
||||
$resultdata = json_decode($result);
|
||||
|
||||
// If it is success
|
||||
if (isset($resultdata->error) && $resultdata->error == 0)
|
||||
{
|
||||
$signed_filename = $temp_folder . '/signed.pdf';
|
||||
file_put_contents($signed_filename, base64_decode($resultdata->retval));
|
||||
return $this->_returnObject(0, 0, $signed_filename);
|
||||
}
|
||||
|
||||
// Otherwise it is an error
|
||||
return $this->_returnObject(1, 1, 'Error while signing the given document');
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private function _returnObject($code, $error, $retval)
|
||||
{
|
||||
$returnObject = new stdClass();
|
||||
$returnObject->code = $code;
|
||||
$returnObject->error = $error;
|
||||
$returnObject->retval = $retval;
|
||||
|
||||
return $returnObject;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -116,6 +116,7 @@ class StundenplanLib
|
||||
return $stundenplan_data;
|
||||
$stundenplan_data = getData($stundenplan_data) ?? [];
|
||||
|
||||
$this->_ci->addMeta("stundenplanData", $stundenplan_data);
|
||||
$function_error = $this->expandObjectInformation($stundenplan_data);
|
||||
if ($function_error)
|
||||
return $function_error;
|
||||
@@ -391,6 +392,39 @@ class StundenplanLib
|
||||
$item->gruppe = $gruppe_obj_array;
|
||||
$item->lektor = $lektor_obj_array;
|
||||
|
||||
$this->_ci->load->library('PermissionLib');
|
||||
$berechtigt_begrenzt = $this->_ci->permissionlib->isBerechtigt('lehre/reservierung:begrenzt', 'sui');
|
||||
|
||||
$now = time();
|
||||
$res_lektor_start = $this->jump_day($now, RES_TAGE_LEKTOR_MIN - 1);
|
||||
$res_lektor_ende = mktime(0, 0, 0, date('m', $now), date('d', $now) + RES_TAGE_LEKTOR_BIS, date('Y', $now));
|
||||
|
||||
$start_date = is_numeric($item->beginn) ? $item->beginn : strtotime($item->beginn);
|
||||
if (!date('w', $start_date)) {
|
||||
$start_date = $this->jump_day($start_date, 1);
|
||||
}
|
||||
|
||||
$start_date_str = date('Y-m-d', $start_date);
|
||||
$res_lektor_start_str = date('Y-m-d', $res_lektor_start);
|
||||
$res_lektor_ende_str = date('Y-m-d', $res_lektor_ende);
|
||||
|
||||
$show_delete = (
|
||||
(
|
||||
$berechtigt_begrenzt &&
|
||||
(
|
||||
(isset($item->insertvon) && $item->insertvon == getAuthUID()) ||
|
||||
(isset($item->uids) && in_array(getAuthUID(), $item->uids))
|
||||
)
|
||||
) &&
|
||||
$start_date_str >= $res_lektor_start_str &&
|
||||
$start_date_str <= $res_lektor_ende_str
|
||||
);
|
||||
|
||||
if ($show_delete)
|
||||
$item->deletable = true;
|
||||
else
|
||||
$item->deletable = false;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -486,6 +520,212 @@ class StundenplanLib
|
||||
return success($stundenplan_data);
|
||||
}
|
||||
|
||||
public function addReservation($start, $end, $title, $beschreibung, $ort_kurzbz, $lektoren = null, $studiengang = null, $semester = null, $verband = null, $gruppe = null, $spezialgruppe = null)
|
||||
{
|
||||
$this->_ci =& get_instance();
|
||||
$this->_ci->load->model('ressource/Stunde_model', 'StundeModel');
|
||||
$this->_ci->load->model('ressource/Reservierung_model', 'ReservierungModel');
|
||||
$this->_ci->load->model('ressource/stundenplandev_model', 'StundenplandevModel');
|
||||
$this->_ci->load->model('ressource/stundenplan_model', 'StundenplanModel');
|
||||
$this->_ci->load->library('PermissionLib');
|
||||
|
||||
$startTime = new DateTime($start);
|
||||
$endTime = new DateTime($end);
|
||||
|
||||
$stunden = $this->_ci->StundeModel->loadWhere(array(
|
||||
'beginn <' => $endTime->format('H:i:s'),
|
||||
'ende >' => $startTime->format('H:i:s')
|
||||
));
|
||||
|
||||
if (!hasData($stunden))
|
||||
{
|
||||
return error("Keine Stunden vorhanden");
|
||||
}
|
||||
|
||||
$stunden = array_column(getData($stunden), 'stunde');
|
||||
|
||||
$this->_ci->StundenplandevModel->db->select('1');
|
||||
$this->_ci->StundenplandevModel->db->where('datum', $startTime->format('Y-m-d'));
|
||||
$this->_ci->StundenplandevModel->db->where('ort_kurzbz', $ort_kurzbz);
|
||||
$this->_ci->StundenplandevModel->db->where_in('stunde', $stunden);
|
||||
$stundenplandev_belegung = $this->_ci->StundenplandevModel->load();
|
||||
|
||||
$this->_ci->StundenplanModel->db->select('1');
|
||||
$this->_ci->StundenplanModel->db->where('ort_kurzbz', $ort_kurzbz);
|
||||
$this->_ci->StundenplanModel->db->where('datum', $startTime->format('Y-m-d'));
|
||||
$this->_ci->StundenplanModel->db->where_in('stunde', $stunden);
|
||||
$stundenplan_belegung = $this->_ci->StundenplanModel->load();
|
||||
|
||||
if ((hasData($stundenplandev_belegung) || hasData($stundenplan_belegung))
|
||||
&& !$this->_ci->permissionlib->isBerechtigt('lehre/reservierungAdvanced'))
|
||||
return error ('lvplan/bereitsReserviert');
|
||||
|
||||
$this->_ci->ReservierungModel->addSelect('stunde');
|
||||
$reservation_hours = $this->_ci->ReservierungModel->loadWhere(array('datum' => $startTime->format('Y-m-d'), 'ort_kurzbz' => $ort_kurzbz));
|
||||
|
||||
|
||||
if (isError($reservation_hours))
|
||||
return $reservation_hours;
|
||||
|
||||
$reservation_hours = hasData($reservation_hours) ? array_column(getData($reservation_hours), 'stunde') : array();
|
||||
|
||||
if (!empty(array_intersect($stunden, $reservation_hours))
|
||||
&& !$this->_ci->permissionlib->isBerechtigt('lehre/reservierungAdvanced'))
|
||||
return error("lvplan/bereitsReserviert");
|
||||
|
||||
|
||||
if (!empty($lektoren))
|
||||
{
|
||||
foreach ($lektoren as $lektor)
|
||||
{
|
||||
$insert = array('ort_kurzbz' => $ort_kurzbz,
|
||||
'datum' => $startTime->format('Y-m-d'),
|
||||
'titel' => $title,
|
||||
'studiengang_kz' => is_null($studiengang) ? 0 : $studiengang,
|
||||
'beschreibung' => $beschreibung,
|
||||
'insertvon' => getAuthUID(),
|
||||
'uid' => $lektor,
|
||||
'semester' => is_null($semester) ? null : $semester,
|
||||
'verband' => is_null($verband) ? null : $verband,
|
||||
'gruppe' => is_null($gruppe) ? null : $gruppe,
|
||||
'gruppe_kurzbz' => is_null($spezialgruppe) ? null : $spezialgruppe,
|
||||
);
|
||||
|
||||
foreach ($stunden as $stunde)
|
||||
{
|
||||
$insert['stunde'] = $stunde;
|
||||
$check_insert = $this->_ci->ReservierungModel->insert($insert);
|
||||
if (isError($check_insert))
|
||||
return $check_insert;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach ($stunden as $stunde)
|
||||
{
|
||||
$check_insert = $this->_ci->ReservierungModel->insert(array(
|
||||
'ort_kurzbz' => $ort_kurzbz,
|
||||
'uid' => getAuthUID(),
|
||||
'stunde' => $stunde,
|
||||
'datum' => $startTime->format('Y-m-d'),
|
||||
'titel' => $title,
|
||||
'studiengang_kz' => is_null($studiengang) ? 0 : $studiengang,
|
||||
'beschreibung' => $beschreibung,
|
||||
'insertvon' => getAuthUID()
|
||||
));
|
||||
if (isError($check_insert))
|
||||
return $check_insert;
|
||||
}
|
||||
}
|
||||
|
||||
return success("Erfolgreich");
|
||||
}
|
||||
|
||||
public function deleteReservation($reservierung_id)
|
||||
{
|
||||
$this->_ci =& get_instance();
|
||||
$this->_ci->load->model('ressource/Reservierung_model', 'ReservierungModel');
|
||||
$this->_ci->load->model('ressource/Stunde_model', 'StundeModel');
|
||||
$this->_ci->load->library('PermissionLib');
|
||||
|
||||
|
||||
$this->_ci->ReservierungModel->db->where_in('reservierung_id', $reservierung_id);
|
||||
$reservation = $this->_ci->ReservierungModel->load();
|
||||
if (isError($reservation))
|
||||
return $reservation;
|
||||
|
||||
if (!hasData($reservation))
|
||||
return error("Reservierungen nicht gefunden");
|
||||
|
||||
$reservations = getData($reservation);
|
||||
|
||||
$today = new DateTime();
|
||||
foreach ($reservations as $reservierung)
|
||||
{
|
||||
if ($today->format('Y-m-d') > $reservierung->datum)
|
||||
return error("Vergangene Reservierungen können nicht gelöscht werden");
|
||||
|
||||
if (($this->_ci->permissionlib->isBerechtigt('lehre/reservierung:begrenzt')) && ($reservierung->insertvon == getAuthUID() || $reservierung->uid === getAuthUID()))
|
||||
{
|
||||
$delete_result = $this->_ci->ReservierungModel->delete($reservierung->reservierung_id);
|
||||
|
||||
if (isError($delete_result))
|
||||
return $delete_result;
|
||||
}
|
||||
}
|
||||
return success("Erfolgreich");
|
||||
}
|
||||
|
||||
|
||||
public function getReservableMap($ort_kurzbz, $start_date, $end_date)
|
||||
{
|
||||
$this->_ci =& get_instance();
|
||||
$this->_ci->load->model('ressource/Ort_model', 'OrtModel');
|
||||
$this->_ci->load->library('PermissionLib');
|
||||
|
||||
$berechtigt_begrenzt = $this->_ci->permissionlib->isBerechtigt('lehre/reservierung:begrenzt', 'suid');
|
||||
$berechtigt_erweitert = $this->_ci->permissionlib->isBerechtigt('lehre/reservierung', 'suid');
|
||||
|
||||
$ort_data = $this->_ci->OrtModel->load($ort_kurzbz);
|
||||
if (isError($ort_data) || !hasData($ort_data))
|
||||
return [];
|
||||
|
||||
$ort_data = getData($ort_data)[0];
|
||||
|
||||
if (!$ort_data->reservieren)
|
||||
return [];
|
||||
|
||||
if (!$berechtigt_begrenzt && !$berechtigt_erweitert)
|
||||
return [];
|
||||
|
||||
$start_ts = is_numeric($start_date) ? (int)$start_date : strtotime($start_date);
|
||||
$end_ts = is_numeric($end_date) ? (int)$end_date : strtotime($end_date);
|
||||
|
||||
if (!$start_ts || !$end_ts)
|
||||
return [];
|
||||
|
||||
if ($end_ts < $start_ts)
|
||||
{
|
||||
$tmp = $start_ts;
|
||||
$start_ts = $end_ts;
|
||||
$end_ts = $tmp;
|
||||
}
|
||||
|
||||
$now = time();
|
||||
$tage_min = defined('RES_TAGE_LEKTOR_MIN') ? (int)RES_TAGE_LEKTOR_MIN : 0;
|
||||
$tage_bis = defined('RES_TAGE_LEKTOR_BIS') ? (int)RES_TAGE_LEKTOR_BIS : 0;
|
||||
|
||||
$datum_res_lektor_start = $this->jump_day($now, $tage_min - 1);
|
||||
$datum_res_lektor_ende = $this->jump_day($now, $tage_bis);
|
||||
|
||||
$start_ymd_allowed = date('Y-m-d', $datum_res_lektor_start);
|
||||
$end_ymd_allowed = date('Y-m-d', $datum_res_lektor_ende);
|
||||
|
||||
$result = [];
|
||||
|
||||
$current = strtotime(date('Y-m-d', $start_ts) . ' 00:00:00');
|
||||
$end_day = strtotime(date('Y-m-d', $end_ts) . ' 00:00:00');
|
||||
|
||||
while ($current <= $end_day)
|
||||
{
|
||||
$ymd = date('Y-m-d', $current);
|
||||
|
||||
$result[$ymd] = ($ymd >= $start_ymd_allowed && $ymd <= $end_ymd_allowed) ? true : false;
|
||||
|
||||
$current = $this->jump_day($current, 1);
|
||||
}
|
||||
|
||||
return success($result);
|
||||
}
|
||||
|
||||
private function jump_day($timestamp, $days)
|
||||
{
|
||||
$days = (int)$days;
|
||||
$prefix = ($days >= 0 ? '+' : '');
|
||||
return strtotime($prefix . $days . ' days', $timestamp);
|
||||
}
|
||||
|
||||
// start of the private functions ########################################################################################################
|
||||
|
||||
// function used to sort an array of studiensemester strings
|
||||
|
||||
@@ -159,8 +159,6 @@ class LvVwLib
|
||||
if (!$stg->mischform)
|
||||
return [];
|
||||
|
||||
$this->_ci->StudiengangModel->db->select('TRUE AS leaf', false);
|
||||
|
||||
return $this->_ci->stglib->orgform($path_template, $stg->studiengang_kz);
|
||||
}
|
||||
|
||||
|
||||
@@ -11,4 +11,73 @@ class Mobilitaet_model extends DB_Model
|
||||
$this->dbTable = 'bis.tbl_mobilitaet';
|
||||
$this->pk = 'mobilitaet_id';
|
||||
}
|
||||
|
||||
public function getMobilityZusatzForUids($uids) {
|
||||
$qry = "SELECT distinct on(nachname, vorname, public.tbl_benutzer.person_id) uid,
|
||||
tbl_mitarbeiter.mitarbeiter_uid,
|
||||
tbl_note.lkt_ueberschreibbar, tbl_note.anmerkung,
|
||||
tbl_mobilitaet.mobilitaetstyp_kurzbz,
|
||||
(CASE WHEN bis.tbl_mobilitaet.studiensemester_kurzbz = vw_student_lehrveranstaltung.studiensemester_kurzbz THEN 1 ELSE 0 END) as doubledegree,
|
||||
public.tbl_prestudent.gsstudientyp_kurzbz as ddtype,
|
||||
(SELECT status_kurzbz FROM public.tbl_prestudentstatus
|
||||
WHERE prestudent_id=tbl_student.prestudent_id
|
||||
ORDER BY datum DESC, insertamum DESC, ext_id DESC LIMIT 1) as studienstatus
|
||||
FROM
|
||||
campus.vw_student_lehrveranstaltung
|
||||
JOIN public.tbl_benutzer USING(uid)
|
||||
JOIN public.tbl_person USING(person_id)
|
||||
LEFT JOIN public.tbl_student ON(uid=student_uid)
|
||||
LEFT JOIN public.tbl_mitarbeiter ON(uid=mitarbeiter_uid)
|
||||
LEFT JOIN public.tbl_studentlehrverband USING(student_uid,studiensemester_kurzbz)
|
||||
LEFT JOIN lehre.tbl_zeugnisnote on(vw_student_lehrveranstaltung.lehrveranstaltung_id=tbl_zeugnisnote.lehrveranstaltung_id
|
||||
AND tbl_zeugnisnote.student_uid=tbl_student.student_uid
|
||||
AND tbl_zeugnisnote.studiensemester_kurzbz=tbl_studentlehrverband.studiensemester_kurzbz)
|
||||
LEFT JOIN lehre.tbl_note USING (note)
|
||||
LEFT JOIN bis.tbl_bisio ON(uid=tbl_bisio.student_uid)
|
||||
LEFT JOIN public.tbl_studiengang ON(tbl_student.studiengang_kz=tbl_studiengang.studiengang_kz)
|
||||
LEFT JOIN bis.tbl_mobilitaet USING(prestudent_id)
|
||||
LEFT JOIN public.tbl_prestudent USING(prestudent_id)
|
||||
WHERE uid IN ?";
|
||||
|
||||
return $this->execReadOnlyQuery($qry, [$uids]);
|
||||
}
|
||||
|
||||
public function formatZusatz($entry, $erhalter_kz) {
|
||||
$zusatz = '';
|
||||
|
||||
if (isset($entry->studienstatus) && $entry->studienstatus === 'Incoming') {
|
||||
$zusatz = '(i)';
|
||||
}
|
||||
|
||||
if (isset($entry->lkt_ueberschreibbar) && $entry->lkt_ueberschreibbar === false) {
|
||||
$zusatz .= ' (' . ($entry->anmerkung ?? '') . ')';
|
||||
}
|
||||
|
||||
if (isset($entry->mitarbeiter_uid) && $entry->mitarbeiter_uid !== null) {
|
||||
$zusatz .= ' (ma)';
|
||||
}
|
||||
|
||||
if (isset($entry->stg_kz_student) && $entry->stg_kz_student == $erhalter_kz) {
|
||||
$zusatz .= ' (a.o.)';
|
||||
}
|
||||
|
||||
if (
|
||||
isset($entry->mobilitaetstyp_kurzbz) && $entry->mobilitaetstyp_kurzbz &&
|
||||
isset($entry->doubledegree) && $entry->doubledegree === 1
|
||||
) {
|
||||
$zusatz .= ' (d.d.';
|
||||
|
||||
$ddtype = $entry->ddtype ?? null;
|
||||
|
||||
if ($ddtype == 'Intern') {
|
||||
$zusatz .= 'i.)';
|
||||
} elseif ($ddtype == 'Extern') {
|
||||
$zusatz .= 'o.)';
|
||||
} else {
|
||||
$zusatz .= ')';
|
||||
}
|
||||
}
|
||||
|
||||
return $zusatz;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,14 +20,16 @@ class News_model extends DB_Model
|
||||
public function getAll($limit = null)
|
||||
{
|
||||
$this->addJoin("campus.tbl_content","content_id");
|
||||
|
||||
return $this->execReadOnlyQuery('
|
||||
SELECT *, TO_CHAR(campus.tbl_news.datum, ?) as datumformatted
|
||||
FROM campus.tbl_news
|
||||
JOIN campus.tbl_content content ON content.content_id = campus.tbl_news.content_id
|
||||
WHERE
|
||||
WHERE
|
||||
--text IS NOT NULL AND
|
||||
datum <= NOW() AND (datum_bis IS NULL OR datum_bis >= now()::date)
|
||||
ORDER BY datum DESC
|
||||
datum <= NOW() AND (datum_bis >= NOW()::date OR datum_bis IS NULL) AND
|
||||
(NOW()-datum) < interval \'' . MAXNEWSALTER . ' days\'
|
||||
ORDER BY datum DESC, campus.tbl_news.updateamum DESC
|
||||
LIMIT ' . $this->escape($limit)
|
||||
, ['DD/MM/YYYY']);
|
||||
}
|
||||
@@ -48,31 +50,28 @@ class News_model extends DB_Model
|
||||
* @param integer | null $semester
|
||||
* @param string $fachbereich_kurzbz
|
||||
* @param boolean $sichtbar
|
||||
* @param integer $maxalter
|
||||
* @param integer $page
|
||||
* @param integer $page_size
|
||||
* @param boolean $all
|
||||
* @param boolean $active
|
||||
* @param boolean $mischen
|
||||
*
|
||||
* TODO(chris): this is not a good function -> the params are all over the place
|
||||
*
|
||||
*/
|
||||
protected function prepareNewsWithContent($sprache, $studiengang_kz, $semester, $fachbereich_kurzbz = null, $sichtbar = true, $maxalter = 0, $page = 1, $page_size = 10, $all = false, $mischen = true)
|
||||
protected function prepareNewsWithContent($sprache, $studiengang_kz, $semester, $fachbereich_kurzbz = null, $sichtbar = true, $page = 1, $page_size = 10, $active = true, $mischen = true, $filterForDegreePrograms = false, $allowedDegreePrograms = [])
|
||||
{
|
||||
|
||||
$this->addSelect(["*", "COUNT(*) OVER() AS row_count"]);
|
||||
$this->addOrder('datum', 'DESC');
|
||||
$this->addOrder('tbl_news.updateamum', 'DESC');
|
||||
|
||||
$studiengang_kz = trim($studiengang_kz);
|
||||
$fachbereich_kurzbz = trim($fachbereich_kurzbz);
|
||||
|
||||
$where = [];
|
||||
if (trim($maxalter) != '0') {
|
||||
$where[] = "(now()-datum) < interval " . $this->db->escape($maxalter) . " days";
|
||||
|
||||
}
|
||||
if (!$all) {
|
||||
$where[] = "datum <= now()";
|
||||
$where[] = "(datum_bis >= now()::date OR datum_bis IS NULL)";
|
||||
|
||||
if ($active) {
|
||||
$where[] = "(datum <= NOW()::date AND (datum_bis >= NOW()::date OR (datum_bis IS NULL AND (NOW()-datum) < interval '" . MAXNEWSALTER . " days')))";
|
||||
}
|
||||
if ($fachbereich_kurzbz != '*') {
|
||||
if ($fachbereich_kurzbz == '') {
|
||||
@@ -82,27 +81,54 @@ class News_model extends DB_Model
|
||||
|
||||
}
|
||||
}
|
||||
if ($studiengang_kz == '0') {
|
||||
$where[] = "studiengang_kz = " . $this->db->escape($studiengang_kz);
|
||||
|
||||
if ($semester === NULL)
|
||||
$where[] = "semester IS NULL";
|
||||
elseif ($semester === 0)
|
||||
$where[] = "semester = 0";
|
||||
} elseif ($studiengang_kz != '') {
|
||||
$add = $mischen === true ? " OR (studiengang_kz = 0 AND semester IS NULL)" : "";
|
||||
$where[] = "((studiengang_kz = " . $this->db->escape($studiengang_kz) . " AND semester = " . $this->db->escape($semester) . ") OR (studiengang_kz = " . $this->db->escape($studiengang_kz) . " AND semester = 0) OR (studiengang_kz = 0 AND semester = " . $this->db->escape($semester) . ")" . $add . ")";
|
||||
$sgAndSemesterCondition = [];
|
||||
|
||||
if ($studiengang_kz !== '') {
|
||||
$sgAndSemesterCondition[] = 'studiengang_kz = ' . $this->db->escape($studiengang_kz);
|
||||
}
|
||||
if ($semester !== null && $semester !== 0) {
|
||||
$sgAndSemesterCondition[] = 'semester = ' . $this->db->escape($semester);
|
||||
}
|
||||
|
||||
$targetedSgAndSemesterCondition = [];
|
||||
|
||||
if (!empty($sgAndSemesterCondition)) {
|
||||
$targetedSgAndSemesterCondition[] = '(' . implode(' AND ', $sgAndSemesterCondition) . ')';
|
||||
}
|
||||
if ($mischen === true) {
|
||||
$targetedSgAndSemesterCondition[] = '(studiengang_kz = 0 AND (semester = 0 OR semester IS NULL))';
|
||||
|
||||
if ($semester !== null && $semester !== 0) {
|
||||
$targetedSgAndSemesterCondition[] = '(studiengang_kz = 0 AND semester = ' . $this->db->escape($semester) . ')';
|
||||
}
|
||||
}
|
||||
|
||||
$finalSgAndSemesterCondition = implode(' OR ', $targetedSgAndSemesterCondition);
|
||||
|
||||
if ($finalSgAndSemesterCondition !== '') {
|
||||
$where[] = "(" . $finalSgAndSemesterCondition . ")";
|
||||
}
|
||||
|
||||
$this->addJoin('campus.tbl_contentsprache cs', 'content_id');
|
||||
|
||||
$where[] = "cs.sichtbar = " . ($sichtbar ? "true" : "false");
|
||||
if (is_bool($sichtbar) || $sichtbar === 'true' || $sichtbar === 'false') {
|
||||
$isSichtbar = filter_var($sichtbar, FILTER_VALIDATE_BOOLEAN);
|
||||
$where[] = "cs.sichtbar = " . ($isSichtbar ? "true" : "false");
|
||||
}
|
||||
|
||||
$where[] = "cs.sprache = (CASE WHEN EXISTS(SELECT 1 FROM campus.tbl_contentsprache cs2 WHERE cs2.content_id=" . $this->dbTable . ".content_id AND sprache=" . $this->db->escape($sprache) . ") THEN " . $this->db->escape($sprache) . " ELSE " . $this->db->escape(DEFAULT_LANGUAGE) . " END)";
|
||||
|
||||
|
||||
$where[] = "cs.version = (SELECT MAX(version) FROM campus.tbl_contentsprache cs3 WHERE cs3.content_id=" . $this->dbTable . ".content_id AND cs3.sprache = (CASE WHEN EXISTS(SELECT 1 FROM campus.tbl_contentsprache cs2 WHERE cs2.content_id=" . $this->dbTable . ".content_id AND sprache=" . $this->db->escape($sprache) . ") THEN " . $this->db->escape($sprache) . " ELSE " . $this->db->escape(DEFAULT_LANGUAGE) . " END))";
|
||||
|
||||
if ($filterForDegreePrograms) {
|
||||
if (empty($allowedDegreePrograms)) {
|
||||
$where[] = "1=0";
|
||||
} else {
|
||||
$where[] = "studiengang_kz IN (" . implode(',', array_map([$this->db, 'escape'], $allowedDegreePrograms)) . ")";
|
||||
}
|
||||
}
|
||||
|
||||
$where = implode(" AND ", $where);
|
||||
|
||||
@@ -110,25 +136,16 @@ class News_model extends DB_Model
|
||||
|
||||
}
|
||||
|
||||
public function getNewsWithContent($sprache, $studiengang_kz, $semester, $fachbereich_kurzbz = null, $sichtbar = true, $maxalter = 0, $page = 1, $page_size = 10, $all = false, $mischen = true)
|
||||
public function getNewsWithContent($sprache, $studiengang_kz, $semester, $fachbereich_kurzbz = null, $sichtbar = true, $page = 1, $page_size = 10, $active = true, $mischen = true, $filterForDegreePrograms = false, $allowedDegreePrograms = [])
|
||||
{
|
||||
$this->prepareNewsWithContent($sprache, $studiengang_kz, $semester, $fachbereich_kurzbz, $sichtbar, $maxalter, $page, $page_size, $all, $mischen);
|
||||
|
||||
$this->prepareNewsWithContent($sprache, $studiengang_kz, $semester, $fachbereich_kurzbz, $sichtbar, $page, $page_size, $active, $mischen, $filterForDegreePrograms, $allowedDegreePrograms);
|
||||
// getting the number of rows of the query and adding pagination to the query result
|
||||
$num_rows = $this->getNumRows(true);
|
||||
$this->addPagination($page, $page_size, $num_rows);
|
||||
|
||||
// preparing the query again because every call to get_compiled_select or cour_all_results will add the from clause to the query
|
||||
$this->prepareNewsWithContent($sprache, $studiengang_kz, $semester, $fachbereich_kurzbz, $sichtbar, $maxalter, $page, $page_size, $all, $mischen);
|
||||
$this->prepareNewsWithContent($sprache, $studiengang_kz, $semester, $fachbereich_kurzbz, $sichtbar, $page, $page_size, $active, $mischen, $filterForDegreePrograms, $allowedDegreePrograms);
|
||||
|
||||
return $this->load();
|
||||
}
|
||||
|
||||
public function countNewsWithContent($sprache, $studiengang_kz, $semester, $fachbereich_kurzbz = null, $sichtbar = true, $maxalter = 0, $page = 1, $page_size = 10, $all = false, $mischen = true)
|
||||
{
|
||||
$this->prepareNewsWithContent($sprache, $studiengang_kz, $semester, $fachbereich_kurzbz, $sichtbar, $maxalter, $page, $page_size, $all, $mischen);
|
||||
return $this->getNumRows();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -248,5 +248,60 @@ class Akte_model extends DB_Model
|
||||
|
||||
return success($dokumente->retval);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Liefert die Archivdokumente einer Person/mehrerer Personen
|
||||
*
|
||||
* @param integer/array $person_id
|
||||
* @param boolean|null $signiert Wenn true werden nur Dokumente geliefert die digital signiert wurden.
|
||||
* @param boolean|null $stud_selfservice Wenn true werden nur Dokumente geliefert die Studierende selbst herunterladen duerfen.
|
||||
*
|
||||
* @return stdClass
|
||||
*/
|
||||
public function getArchiv($person_id, $signiert = null, $stud_selfservice = null)
|
||||
{
|
||||
$this->addSelect('akte_id');
|
||||
$this->addSelect('person_id');
|
||||
$this->addSelect('dokument_kurzbz');
|
||||
$this->addSelect('mimetype');
|
||||
$this->addSelect('erstelltam');
|
||||
$this->addSelect('gedruckt');
|
||||
$this->addSelect('titel_intern');
|
||||
$this->addSelect('anmerkung_intern');
|
||||
$this->addSelect('titel');
|
||||
$this->addSelect('bezeichnung');
|
||||
$this->addSelect('updateamum');
|
||||
$this->addSelect('insertamum');
|
||||
$this->addSelect('updatevon');
|
||||
$this->addSelect('insertvon');
|
||||
$this->addSelect('uid');
|
||||
$this->addSelect('dms_id');
|
||||
$this->addSelect('anmerkung');
|
||||
$this->addSelect('nachgereicht');
|
||||
$this->addSelect('CASE WHEN inhalt is not null THEN true ELSE false END as inhalt_vorhanden', false);
|
||||
$this->addSelect('nachgereicht_am');
|
||||
$this->addSelect('ausstellungsnation');
|
||||
$this->addSelect('formal_geprueft_amum');
|
||||
$this->addSelect('archiv');
|
||||
$this->addSelect('signiert');
|
||||
$this->addSelect('stud_selfservice');
|
||||
$this->addSelect('akzeptiertamum');
|
||||
|
||||
if ($signiert !== null)
|
||||
$this->db->where('signiert', (boolean)$signiert);
|
||||
if ($stud_selfservice !== null)
|
||||
$this->db->where('stud_selfservice', (boolean)$stud_selfservice);
|
||||
|
||||
if (is_array($person_id))
|
||||
$this->db->where_in('person_id', $person_id);
|
||||
else
|
||||
$this->db->where('person_id', $person_id);
|
||||
|
||||
$this->addOrder('erstelltam', 'DESC');
|
||||
$this->addOrder('akte_id', 'DESC');
|
||||
|
||||
return $this->loadWhere([
|
||||
'archiv' => true
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -88,6 +88,30 @@ class Prestudent_model extends DB_Model
|
||||
return $this->execQuery($query, $parametersArray);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the Studiengang and current Ausbildungssemester for every
|
||||
* Prestudent belonging to the same person as the student.
|
||||
*
|
||||
* @param string $student_uid
|
||||
* @return stdClass
|
||||
*/
|
||||
public function getStudiengaengAndAusbildungssemesterByStudentUid($student_uid)
|
||||
{
|
||||
$query = 'SELECT p.studiengang_kz,
|
||||
(
|
||||
SELECT ps.ausbildungssemester
|
||||
FROM public.tbl_prestudentstatus ps
|
||||
WHERE ps.prestudent_id = p.prestudent_id
|
||||
ORDER BY ps.datum DESC, ps.insertamum DESC, ps.ext_id DESC
|
||||
LIMIT 1
|
||||
) AS ausbildungssemester
|
||||
FROM public.tbl_student s
|
||||
JOIN public.tbl_prestudent p USING (prestudent_id)
|
||||
WHERE s.student_uid = ?';
|
||||
|
||||
return $this->execQuery($query, array($student_uid));
|
||||
}
|
||||
|
||||
/**
|
||||
* updateAufnahmegruppe
|
||||
*/
|
||||
|
||||
@@ -100,12 +100,14 @@ class Abschlusspruefung_model extends DB_Model
|
||||
|
||||
if (isError($abschlussarbeit))
|
||||
return $abschlussarbeit;
|
||||
|
||||
if (hasData($abschlussarbeit))
|
||||
{
|
||||
$abschlussarbeit = getData($abschlussarbeit)[0];
|
||||
$abschlusspruefungdata->projektarbeit_studiengangstyp_name = $abschlussarbeit->projekttyp_kurzbz;
|
||||
$abschlusspruefungdata->abschlussarbeit_titel = $abschlussarbeit->titel;
|
||||
$abschlusspruefungdata->abschlussarbeit_note = $abschlussarbeit->note;
|
||||
$abschlusspruefungdata->abschlussarbeit_sprache = $abschlussarbeit->sprache_bezeichnung;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,4 +52,53 @@ class LePruefung_model extends DB_Model
|
||||
'student_uid' => $student_uid
|
||||
]);
|
||||
}
|
||||
|
||||
public function getPruefungenByLvStudiensemester($lv_id, $sem_kurzbz) {
|
||||
$qry = "SELECT lehre.tbl_pruefung.*, tbl_lehrveranstaltung.bezeichnung as lehrveranstaltung_bezeichnung, tbl_lehrveranstaltung.lehrveranstaltung_id,
|
||||
tbl_note.bezeichnung as note_bezeichnung, tbl_pruefungstyp.beschreibung as typ_beschreibung, tbl_lehreinheit.studiensemester_kurzbz as studiensemester_kurzbz
|
||||
FROM lehre.tbl_pruefung, lehre.tbl_lehreinheit, lehre.tbl_lehrveranstaltung, lehre.tbl_note, lehre.tbl_pruefungstyp
|
||||
WHERE lehre.tbl_pruefung.lehreinheit_id=tbl_lehreinheit.lehreinheit_id
|
||||
AND tbl_lehreinheit.lehrveranstaltung_id=tbl_lehrveranstaltung.lehrveranstaltung_id
|
||||
AND lehre.tbl_pruefung.note = tbl_note.note
|
||||
AND lehre.tbl_pruefung.pruefungstyp_kurzbz=tbl_pruefungstyp.pruefungstyp_kurzbz
|
||||
AND tbl_lehrveranstaltung.lehrveranstaltung_id = ?
|
||||
AND tbl_lehreinheit.studiensemester_kurzbz = ?
|
||||
ORDER BY datum DESC;";
|
||||
|
||||
return $this->execReadOnlyQuery($qry, array($lv_id, $sem_kurzbz));
|
||||
}
|
||||
|
||||
public function getPruefungenByUidTypLvStudiensemester($uid, $typ = null, $lv_id = null, $sem_kurzbz = null) {
|
||||
$params = [$uid];
|
||||
$qry = "SELECT tbl_pruefung.*, tbl_lehrveranstaltung.bezeichnung as lehrveranstaltung_bezeichnung, tbl_lehrveranstaltung.lehrveranstaltung_id,
|
||||
tbl_note.bezeichnung as note_bezeichnung, tbl_pruefungstyp.beschreibung as typ_beschreibung, tbl_lehreinheit.studiensemester_kurzbz as studiensemester_kurzbz
|
||||
FROM lehre.tbl_pruefung, lehre.tbl_lehreinheit, lehre.tbl_lehrveranstaltung, lehre.tbl_note, lehre.tbl_pruefungstyp
|
||||
WHERE student_uid= ?
|
||||
AND tbl_pruefung.lehreinheit_id=tbl_lehreinheit.lehreinheit_id
|
||||
AND tbl_lehreinheit.lehrveranstaltung_id=tbl_lehrveranstaltung.lehrveranstaltung_id
|
||||
AND tbl_pruefung.note = tbl_note.note
|
||||
AND tbl_pruefung.pruefungstyp_kurzbz=tbl_pruefungstyp.pruefungstyp_kurzbz";
|
||||
if ($typ != null)
|
||||
{
|
||||
$qry .= " AND tbl_pruefungstyp.pruefungstyp_kurzbz = ?";
|
||||
$params[] = $typ;
|
||||
}
|
||||
|
||||
if ($lv_id != null)
|
||||
{
|
||||
$qry .= " AND tbl_lehrveranstaltung.lehrveranstaltung_id = ?";
|
||||
$params[] = $lv_id;
|
||||
}
|
||||
|
||||
if ($sem_kurzbz != null)
|
||||
{
|
||||
$qry .= " AND tbl_lehreinheit.studiensemester_kurzbz = ?";
|
||||
$params[] = $sem_kurzbz;
|
||||
}
|
||||
|
||||
|
||||
$qry .= " ORDER BY datum DESC";
|
||||
|
||||
return $this->execReadOnlyQuery($qry, $params);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -340,6 +340,20 @@ EOSQL;
|
||||
}
|
||||
|
||||
|
||||
public function getByLeStudiensemester($lehreinheit_id, $studiensemester_kurzbz)
|
||||
{
|
||||
$qry = "WITH lehreinheiten AS (
|
||||
SELECT *
|
||||
FROM lehre.tbl_lehreinheit
|
||||
WHERE lehreinheit_id = ?
|
||||
AND studiensemester_kurzbz = ?
|
||||
)," . $this->_getLeCTE();
|
||||
|
||||
$params = array($lehreinheit_id, $studiensemester_kurzbz);
|
||||
|
||||
return $this->execReadOnlyQuery($qry, $params);
|
||||
|
||||
}
|
||||
public function getByLvidStudiensemester($lv_id, $studiensemester_kurzbz, $mitarbeiter_uid = null, $fachbereich_kurzbz = null)
|
||||
{
|
||||
$qry = "WITH lehreinheiten AS (
|
||||
@@ -347,35 +361,7 @@ EOSQL;
|
||||
FROM lehre.tbl_lehreinheit
|
||||
WHERE lehrveranstaltung_id = ?
|
||||
AND studiensemester_kurzbz = ?
|
||||
),
|
||||
". $this->_getGruppenCTE() . ",
|
||||
". $this->_getLektorenCTE() . ",
|
||||
". $this->_getFachbereichCTE() . ",
|
||||
". $this->_getTagsCTE() . "
|
||||
|
||||
SELECT lehreinheiten.*,
|
||||
lehreinheiten.lehrform_kurzbz as lv_lehrform_kurzbz,
|
||||
tbl_lehrveranstaltung.kurzbz as lv_kurzbz,
|
||||
tbl_lehrveranstaltung.bezeichnung as lv_bezeichnung,
|
||||
COALESCE(tag_data_agg.tags, '[]'::json) AS tags,
|
||||
gruppen.gruppen,
|
||||
mitarbeiter.lektoren,
|
||||
mitarbeiter.le_planstunden,
|
||||
mitarbeiter.vorname,
|
||||
mitarbeiter.nachname,
|
||||
mitarbeiter.semesterstunden,
|
||||
fachbereich.bezeichnung as fachbereich,
|
||||
UPPER(CONCAT(tbl_studiengang.typ,tbl_studiengang.kurzbz)) as studiengang,
|
||||
semester
|
||||
FROM lehreinheiten
|
||||
LEFT JOIN lehre.tbl_lehrveranstaltung ON tbl_lehrveranstaltung.lehrveranstaltung_id = lehreinheiten.lehrfach_id
|
||||
LEFT JOIN public.tbl_studiengang USING(studiengang_kz)
|
||||
LEFT JOIN tag_data_agg ON tag_data_agg.lehreinheit_id = lehreinheiten.lehreinheit_id
|
||||
LEFT JOIN mitarbeiter ON lehreinheiten.lehreinheit_id = mitarbeiter.lehreinheit_id
|
||||
LEFT JOIN fachbereich ON lehreinheiten.lehreinheit_id = fachbereich.lehreinheit_id
|
||||
LEFT JOIN gruppen ON lehreinheiten.lehreinheit_id = gruppen.lehreinheit_id
|
||||
WHERE true
|
||||
";
|
||||
)," . $this->_getLeCTE();
|
||||
|
||||
$params = array($lv_id, $studiensemester_kurzbz);
|
||||
|
||||
@@ -395,9 +381,83 @@ EOSQL;
|
||||
return $this->execReadOnlyQuery($qry, $params);
|
||||
}
|
||||
|
||||
private function getLVTmp($stg_kz = null)
|
||||
public function getOffeneStunden($lehreinheit_ids)
|
||||
{
|
||||
$qry = "SELECT DISTINCT ON(lehrveranstaltung_id) *,
|
||||
if (!is_array($lehreinheit_ids))
|
||||
$lehreinheit_ids = [$lehreinheit_ids];
|
||||
|
||||
if (empty($lehreinheit_ids))
|
||||
return success([]);
|
||||
|
||||
$db = new DB_Model();
|
||||
$placeholders = implode(',', array_fill(0, count($lehreinheit_ids), '?'));
|
||||
|
||||
$qry = "WITH eventdauer AS (
|
||||
SELECT
|
||||
tbl_kalender_lehreinheit.lehreinheit_id,
|
||||
tbl_kalender.von,
|
||||
tbl_kalender.bis,
|
||||
tbl_kalender.kalender_id
|
||||
FROM lehre.tbl_lehreinheit
|
||||
JOIN lehre.tbl_kalender_lehreinheit USING(lehreinheit_id)
|
||||
JOIN lehre.tbl_kalender USING(kalender_id)
|
||||
WHERE tbl_lehreinheit.lehreinheit_id IN ($placeholders)
|
||||
AND NOT EXISTS (SELECT 1 FROM lehre.tbl_kalender nachfolger
|
||||
WHERE nachfolger.vorgaenger_kalender_id = tbl_kalender.kalender_id)
|
||||
AND tbl_kalender.status_kurzbz NOT IN ('deleted', 'todelete', 'archived')
|
||||
GROUP BY tbl_kalender_lehreinheit.lehreinheit_id, tbl_kalender.von, tbl_kalender.bis, tbl_kalender.kalender_id
|
||||
),
|
||||
raster AS (
|
||||
SELECT
|
||||
eventdauer.lehreinheit_id,
|
||||
eventdauer.kalender_id,
|
||||
eventdauer.von,
|
||||
eventdauer.bis,
|
||||
vonstunde.stunde AS vonstunde_nr,
|
||||
bisstunde.stunde AS bisstunde_nr
|
||||
FROM eventdauer
|
||||
LEFT JOIN lehre.tbl_stunde vonstunde ON eventdauer.von::time = vonstunde.beginn
|
||||
LEFT JOIN lehre.tbl_stunde bisstunde ON eventdauer.bis::time = bisstunde.ende
|
||||
),
|
||||
unterrichtsdauer AS (
|
||||
SELECT
|
||||
raster.lehreinheit_id,
|
||||
raster.kalender_id,
|
||||
sum(EXTRACT(EPOCH FROM (LEAST(stunde.ende, raster.bis::time) - GREATEST(stunde.beginn, raster.von::time))) / 60) AS minuten
|
||||
FROM raster JOIN lehre.tbl_stunde stunde ON stunde.beginn < raster.bis::time AND stunde.ende > raster.von::time
|
||||
WHERE raster.vonstunde_nr IS NULL OR raster.bisstunde_nr IS NULL
|
||||
GROUP BY raster.lehreinheit_id, raster.kalender_id
|
||||
),
|
||||
verplantestunden AS (
|
||||
SELECT raster.lehreinheit_id, raster.kalender_id,
|
||||
CASE
|
||||
WHEN raster.vonstunde_nr IS NOT NULL AND raster.bisstunde_nr IS NOT NULL
|
||||
THEN (raster.bisstunde_nr - raster.vonstunde_nr + 1)
|
||||
ELSE coalesce(unterrichtsdauer.minuten, 0) / 45
|
||||
END AS verplantestunde
|
||||
FROM raster LEFT JOIN unterrichtsdauer ON unterrichtsdauer.lehreinheit_id = raster.lehreinheit_id AND unterrichtsdauer.kalender_id = raster.kalender_id
|
||||
),
|
||||
verplant_gesamt AS (
|
||||
SELECT lehreinheit_id, SUM(verplantestunde) AS verplant
|
||||
FROM verplantestunden
|
||||
GROUP BY lehreinheit_id
|
||||
)
|
||||
SELECT
|
||||
lema.lehreinheit_id,
|
||||
lema.mitarbeiter_uid,
|
||||
lema.planstunden,
|
||||
ROUND(coalesce(verplant_gesamt.verplant, 0), 2) AS verplant,
|
||||
ROUND((lema.planstunden - coalesce(verplant_gesamt.verplant, 0)), 2) AS offenestunden
|
||||
FROM lehre.tbl_lehreinheitmitarbeiter lema
|
||||
LEFT JOIN verplant_gesamt ON verplant_gesamt.lehreinheit_id = lema.lehreinheit_id
|
||||
WHERE lema.lehreinheit_id IN ($placeholders)";
|
||||
|
||||
return $db->execReadOnlyQuery($qry, array_merge($lehreinheit_ids, $lehreinheit_ids));
|
||||
}
|
||||
|
||||
private function getLVTmp()
|
||||
{
|
||||
return "SELECT DISTINCT ON(lehrveranstaltung_id) *,
|
||||
'' as stundenblockung,
|
||||
'' as lehreinheit_id,
|
||||
'' as wochenrythmus,
|
||||
@@ -408,24 +468,33 @@ EOSQL;
|
||||
'' as studienplan_beeichnung,
|
||||
UPPER(CONCAT(vw_lehreinheit.stg_typ, vw_lehreinheit.stg_kurzbz)) as studiengang
|
||||
FROM campus.vw_lehreinheit
|
||||
WHERE mitarbeiter_uid = ?
|
||||
AND studiensemester_kurzbz = ?";
|
||||
|
||||
if (!is_null($stg_kz)) {
|
||||
$qry .= " AND lv_studiengang_kz = ?";
|
||||
}
|
||||
|
||||
return $qry;
|
||||
WHERE studiensemester_kurzbz = ? ";
|
||||
}
|
||||
|
||||
public function getLvsByEmployee($mitarbeiter_uid, $studiensemester_kurzbz, $stg_kz = null)
|
||||
public function getLvsById($lehrveranstaltung_id, $studiensemester_kurzbz)
|
||||
{
|
||||
$qry = "WITH lvs AS (" . $this->getLVTmp($stg_kz) . ")
|
||||
$where = ' AND lehrveranstaltung_id = ?';
|
||||
$qry = "WITH lvs AS (" . $this->getLVTmp() . $where .")
|
||||
SELECT lvs.*
|
||||
FROM lvs
|
||||
";
|
||||
";
|
||||
|
||||
$params = array($studiensemester_kurzbz, $lehrveranstaltung_id);
|
||||
return $this->execReadOnlyQuery($qry, $params);
|
||||
}
|
||||
public function getLvsByEmployee($mitarbeiter_uid, $studiensemester_kurzbz, $stg_kz = null)
|
||||
{
|
||||
$where = ' AND mitarbeiter_uid = ?';
|
||||
|
||||
if ($stg_kz != null)
|
||||
$where .= " AND lv_studiengang_kz = ?";
|
||||
|
||||
$qry = "WITH lvs AS (" . $this->getLVTmp() . $where .")
|
||||
SELECT lvs.*
|
||||
FROM lvs";
|
||||
|
||||
$params = array($studiensemester_kurzbz, $mitarbeiter_uid);
|
||||
|
||||
$params = array($mitarbeiter_uid, $studiensemester_kurzbz);
|
||||
if (!is_null($stg_kz))
|
||||
{
|
||||
$params[] = $stg_kz;
|
||||
@@ -632,6 +701,36 @@ EOSQL;
|
||||
return success('Contract successfully updated.');
|
||||
}
|
||||
|
||||
private function _getLeCTE()
|
||||
{
|
||||
return $this->_getGruppenCTE() . ",
|
||||
". $this->_getLektorenCTE() . ",
|
||||
". $this->_getFachbereichCTE() . ",
|
||||
". $this->_getTagsCTE() . "
|
||||
|
||||
SELECT lehreinheiten.*,
|
||||
lehreinheiten.lehrform_kurzbz as lv_lehrform_kurzbz,
|
||||
tbl_lehrveranstaltung.kurzbz as lv_kurzbz,
|
||||
tbl_lehrveranstaltung.bezeichnung as lv_bezeichnung,
|
||||
COALESCE(tag_data_agg.tags, '[]'::json) AS tags,
|
||||
gruppen.gruppen,
|
||||
mitarbeiter.lektoren,
|
||||
mitarbeiter.le_planstunden,
|
||||
mitarbeiter.vorname,
|
||||
mitarbeiter.nachname,
|
||||
mitarbeiter.semesterstunden,
|
||||
fachbereich.bezeichnung as fachbereich,
|
||||
UPPER(CONCAT(tbl_studiengang.typ,tbl_studiengang.kurzbz)) as studiengang,
|
||||
semester
|
||||
FROM lehreinheiten
|
||||
LEFT JOIN lehre.tbl_lehrveranstaltung ON tbl_lehrveranstaltung.lehrveranstaltung_id = lehreinheiten.lehrfach_id
|
||||
LEFT JOIN public.tbl_studiengang USING(studiengang_kz)
|
||||
LEFT JOIN tag_data_agg ON tag_data_agg.lehreinheit_id = lehreinheiten.lehreinheit_id
|
||||
LEFT JOIN mitarbeiter ON lehreinheiten.lehreinheit_id = mitarbeiter.lehreinheit_id
|
||||
LEFT JOIN fachbereich ON lehreinheiten.lehreinheit_id = fachbereich.lehreinheit_id
|
||||
LEFT JOIN gruppen ON lehreinheiten.lehreinheit_id = gruppen.lehreinheit_id
|
||||
WHERE true";
|
||||
}
|
||||
private function _getGruppenCTE()
|
||||
{
|
||||
return "gruppen AS (
|
||||
@@ -741,4 +840,69 @@ EOSQL;
|
||||
)";
|
||||
}
|
||||
|
||||
|
||||
public function getAllLehreinheitenForLvaAndMaUid($lva_id, $ma_uid, $sem_kurzbz)
|
||||
{
|
||||
$query = "SELECT DISTINCT tbl_lehreinheitmitarbeiter.lehreinheit_id, tbl_lehreinheit.lehrveranstaltung_id, tbl_lehreinheit.lehrform_kurzbz,
|
||||
tbl_lehreinheitmitarbeiter.mitarbeiter_uid,
|
||||
tbl_lehreinheitgruppe.semester,
|
||||
tbl_lehreinheitgruppe.verband,
|
||||
tbl_lehreinheitgruppe.gruppe,
|
||||
tbl_lehreinheitgruppe.gruppe_kurzbz,
|
||||
tbl_lehrveranstaltung.kurzbz,
|
||||
tbl_studiengang.kurzbzlang,
|
||||
(SELECT COUNT(DISTINCT datum) FROM campus.vw_stundenplan WHERE lehreinheit_id = lehre.tbl_lehreinheit.lehreinheit_id) as termincount,
|
||||
(SELECT COUNT(*) FROM campus.vw_student_lehrveranstaltung WHERE lehreinheit_id = lehre.tbl_lehreinheit.lehreinheit_id) as studentcount
|
||||
FROM lehre.tbl_lehreinheit JOIN lehre.tbl_lehreinheitmitarbeiter USING(lehreinheit_id)
|
||||
JOIN lehre.tbl_lehreinheitgruppe USING(lehreinheit_id)
|
||||
JOIN lehre.tbl_lehrveranstaltung USING(lehrveranstaltung_id)
|
||||
JOIN public.tbl_studiengang ON (tbl_lehreinheitgruppe.studiengang_kz = tbl_studiengang.studiengang_kz)
|
||||
WHERE lehrveranstaltung_id = ? AND studiensemester_kurzbz = ? AND mitarbeiter_uid = ?
|
||||
ORDER BY tbl_lehreinheitgruppe.gruppe_kurzbz";
|
||||
|
||||
return $this->execQuery($query, [$lva_id, $sem_kurzbz, $ma_uid]);
|
||||
}
|
||||
|
||||
public function getLehrenheitenBySemester($uid, $semester)
|
||||
{
|
||||
$query = "SELECT
|
||||
tbl_lehreinheit.lehreinheit_id,
|
||||
lehrfach.kurzbz as lehrfach,
|
||||
tbl_lehreinheit.lehrform_kurzbz as lehrform,
|
||||
tbl_lehrveranstaltung.bezeichnung as lv_bezeichnung,
|
||||
(SELECT kurzbz FROM public.tbl_mitarbeiter
|
||||
WHERE mitarbeiter_uid=tbl_lehreinheitmitarbeiter.mitarbeiter_uid) as lektor,
|
||||
UPPER(tbl_studiengang.typ::varchar(1) || tbl_studiengang.kurzbz) as stg_kurzbz,
|
||||
tbl_lehrveranstaltung.semester as lv_semester,
|
||||
tbl_lehreinheit.raumtyp,
|
||||
tbl_lehreinheit.raumtypalternativ,
|
||||
tbl_lehreinheit.stundenblockung,
|
||||
tbl_lehreinheit.wochenrythmus,
|
||||
tbl_lehreinheitmitarbeiter.semesterstunden as semesterstunden,
|
||||
tbl_lehreinheit.start_kw,
|
||||
lvangebot.anmeldefenster_start,
|
||||
lvangebot.anmeldefenster_ende,
|
||||
tbl_lehrveranstaltung.lehrveranstaltung_id
|
||||
FROM
|
||||
lehre.tbl_lehreinheit JOIN lehre.tbl_lehreinheitmitarbeiter USING(lehreinheit_id)
|
||||
JOIN lehre.tbl_lehrveranstaltung USING(lehrveranstaltung_id)
|
||||
JOIN public.tbl_studiengang USING(studiengang_kz)
|
||||
JOIN lehre.tbl_lehrveranstaltung as lehrfach ON(tbl_lehreinheit.lehrfach_id=lehrfach.lehrveranstaltung_id)
|
||||
LEFT JOIN lehre.tbl_lvangebot as lvangebot ON(tbl_lehrveranstaltung.lehrveranstaltung_id=lvangebot.lehrveranstaltung_id)
|
||||
WHERE
|
||||
tbl_lehreinheit.studiensemester_kurzbz = '$semester'
|
||||
AND mitarbeiter_uid = '$uid'
|
||||
ORDER BY stg_kurzbz,lv_semester,lv_bezeichnung";
|
||||
|
||||
return $this->execReadOnlyQuery($query);
|
||||
}
|
||||
|
||||
public function getGroupsByLehreinheit($lehreinheitId)
|
||||
{
|
||||
$query = "SELECT *
|
||||
FROM lehre.tbl_lehreinheitgruppe
|
||||
WHERE lehreinheit_id='$lehreinheitId'";
|
||||
|
||||
return $this->execReadOnlyQuery($query);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -317,7 +317,7 @@ class Lehrveranstaltung_model extends DB_Model
|
||||
tbl_bisio.bisio_id, tbl_bisio.von, tbl_bisio.bis, tbl_student.studiengang_kz AS stg_kz_student,
|
||||
tbl_zeugnisnote.note, tbl_mitarbeiter.mitarbeiter_uid, tbl_person.matr_nr, tbl_benutzer.uid,
|
||||
UPPER(tbl_studiengang.typ::varchar(1) || tbl_studiengang.kurzbz) as kuerzel, tbl_studiengang.orgform_kurzbz, vw_student_lehrveranstaltung.semester, vw_student_lehrveranstaltung.studiensemester_kurzbz, vw_student_lehrveranstaltung.bezeichnung,
|
||||
tbl_student.prestudent_id
|
||||
tbl_student.prestudent_id, campus.vw_student_lehrveranstaltung.lehreinheit_id
|
||||
FROM
|
||||
campus.vw_student_lehrveranstaltung
|
||||
JOIN public.tbl_benutzer USING(uid)
|
||||
@@ -1379,4 +1379,114 @@ class Lehrveranstaltung_model extends DB_Model
|
||||
|
||||
return $this->execQuery($qry, $params);
|
||||
}
|
||||
|
||||
public function getLvForLektorInSemester($sem_kurzbz, $uid) {
|
||||
$qry = "SELECT DISTINCT (tbl_lehrveranstaltung.lehrveranstaltung_id),
|
||||
UPPER(tbl_studiengang.typ::varchar(1) || tbl_studiengang.kurzbz) as stg_kurzbz,
|
||||
tbl_studiengang.studiengang_kz,
|
||||
tbl_lehrveranstaltung.semester as lv_semester,
|
||||
tbl_lehrveranstaltung.bezeichnung as lv_bezeichnung,
|
||||
(SELECT kurzbz FROM public.tbl_mitarbeiter
|
||||
WHERE mitarbeiter_uid=tbl_lehreinheitmitarbeiter.mitarbeiter_uid) as lektor,
|
||||
lehre.tbl_lehrveranstaltung.orgform_kurzbz as orgform
|
||||
|
||||
FROM
|
||||
lehre.tbl_lehreinheit JOIN lehre.tbl_lehreinheitmitarbeiter USING(lehreinheit_id)
|
||||
JOIN lehre.tbl_lehrveranstaltung USING(lehrveranstaltung_id)
|
||||
JOIN public.tbl_studiengang USING(studiengang_kz)
|
||||
JOIN lehre.tbl_lehrveranstaltung as lehrfach ON(tbl_lehreinheit.lehrfach_id=lehrfach.lehrveranstaltung_id)
|
||||
WHERE
|
||||
tbl_lehreinheit.studiensemester_kurzbz = ?
|
||||
AND mitarbeiter_uid = ?
|
||||
ORDER BY stg_kurzbz,lv_semester,lv_bezeichnung";
|
||||
|
||||
return $this->execReadOnlyQuery($qry, array($sem_kurzbz, $uid));
|
||||
}
|
||||
|
||||
// used for cis4 mylv mitarbeiter
|
||||
public function getLvsByMitarbeiterInSemester($mitarbeiter_uid, $sem_kurzbz) {
|
||||
$qry = "SELECT * FROM (
|
||||
SELECT DISTINCT ON (lehre.tbl_lehrveranstaltung.lehrveranstaltung_id)
|
||||
public.tbl_studiengang.studiengang_kz,
|
||||
lehre.tbl_lehrveranstaltung.semester,
|
||||
public.tbl_studiengang.bezeichnung as sg_bezeichnung,
|
||||
public.tbl_studiengang.english as sg_bezeichnung_eng,
|
||||
UPPER(tbl_studiengang.typ::varchar(1) || tbl_studiengang.kurzbz) as studiengang_kuerzel,
|
||||
lehre.tbl_lehrveranstaltung.lehrveranstaltung_id,
|
||||
lehre.tbl_lehrveranstaltung.bezeichnung,
|
||||
lehre.tbl_lehrveranstaltung.bezeichnung_english as bezeichnung_eng,
|
||||
lehre.tbl_lehrveranstaltung.farbe,
|
||||
lehre.tbl_lehrveranstaltung.lvinfo,
|
||||
lehre.tbl_lehrveranstaltung.benotung,
|
||||
lehre.tbl_lehrveranstaltung.orgform_kurzbz,
|
||||
lehre.tbl_lehrveranstaltung.sprache,
|
||||
lehre.tbl_lehrveranstaltung.ects,
|
||||
lehre.tbl_lehrveranstaltung.incoming
|
||||
FROM
|
||||
lehre.tbl_lehreinheit JOIN lehre.tbl_lehreinheitmitarbeiter USING(lehreinheit_id)
|
||||
JOIN lehre.tbl_lehrveranstaltung USING(lehrveranstaltung_id)
|
||||
JOIN public.tbl_studiengang USING(studiengang_kz)
|
||||
JOIN lehre.tbl_lehrveranstaltung as lehrfach ON(tbl_lehreinheit.lehrfach_id=lehrfach.lehrveranstaltung_id)
|
||||
WHERE
|
||||
tbl_lehreinheit.studiensemester_kurzbz = ?
|
||||
AND mitarbeiter_uid = ?) as distincted_by_lva_id
|
||||
JOIN (
|
||||
SELECT lehrveranstaltung_id, TRUNC(SUM(lehre.tbl_lehreinheitmitarbeiter.semesterstunden)) as semesterstunden
|
||||
FROM lehre.tbl_lehreinheit
|
||||
JOIN lehre.tbl_lehreinheitmitarbeiter USING(lehreinheit_id)
|
||||
JOIN lehre.tbl_lehrveranstaltung USING(lehrveranstaltung_id)
|
||||
WHERE tbl_lehreinheit.studiensemester_kurzbz = ?
|
||||
AND mitarbeiter_uid = ?
|
||||
GROUP BY lehrveranstaltung_id
|
||||
) semesterstundenAggregatedSubquery USING(lehrveranstaltung_id)
|
||||
ORDER BY studiengang_kuerzel, semester, bezeichnung";
|
||||
|
||||
return $this->execReadOnlyQuery($qry, [$sem_kurzbz, $mitarbeiter_uid, $sem_kurzbz, $mitarbeiter_uid]);
|
||||
}
|
||||
|
||||
/**
|
||||
* All Lehrveranstaltungen of a Studiengang offered in a Studiensemester.
|
||||
*/
|
||||
public function getLvForStudiengangInSemester($sem_kurzbz, $studiengang_kz) {
|
||||
$qry = "SELECT DISTINCT (tbl_lehrveranstaltung.lehrveranstaltung_id),
|
||||
UPPER(tbl_studiengang.typ::varchar(1) || tbl_studiengang.kurzbz) as stg_kurzbz,
|
||||
tbl_studiengang.studiengang_kz,
|
||||
tbl_lehrveranstaltung.semester as lv_semester,
|
||||
tbl_lehrveranstaltung.bezeichnung as lv_bezeichnung,
|
||||
tbl_lehrveranstaltung.orgform_kurzbz as orgform
|
||||
FROM
|
||||
lehre.tbl_lehrveranstaltung JOIN public.tbl_studiengang USING(studiengang_kz)
|
||||
WHERE
|
||||
tbl_lehrveranstaltung.studiengang_kz = ?
|
||||
AND tbl_lehrveranstaltung.aktiv = TRUE
|
||||
AND EXISTS (
|
||||
SELECT 1 FROM lehre.tbl_lehreinheit le
|
||||
WHERE le.lehrveranstaltung_id = tbl_lehrveranstaltung.lehrveranstaltung_id
|
||||
AND le.studiensemester_kurzbz = ?
|
||||
)
|
||||
ORDER BY stg_kurzbz,lv_semester,lv_bezeichnung";
|
||||
|
||||
return $this->execReadOnlyQuery($qry, array($studiengang_kz, $sem_kurzbz));
|
||||
}
|
||||
|
||||
/**
|
||||
* Number of Lehreinheit assignments the given mitarbeiter has for a Lehrveranstaltung (i.e. whether
|
||||
* they teach it), optionally restricted to a Studiensemester. Returns a single row with a `teaches`
|
||||
* count - check `teaches > 0`. Used to scope teacher access in the Benotungstool to their own LVs.
|
||||
*/
|
||||
public function getLektorIsTeachingLva($lva_id, $ma_uid, $studiensemester_kurzbz = null)
|
||||
{
|
||||
$params = array($lva_id, $ma_uid);
|
||||
$query = "SELECT COUNT(*) AS teaches
|
||||
FROM lehre.tbl_lehreinheitmitarbeiter
|
||||
JOIN lehre.tbl_lehreinheit USING (lehreinheit_id)
|
||||
JOIN lehre.tbl_lehrveranstaltung USING (lehrveranstaltung_id)
|
||||
WHERE lehrveranstaltung_id = ? AND mitarbeiter_uid = ?";
|
||||
if ($studiensemester_kurzbz !== null && $studiensemester_kurzbz !== '') {
|
||||
$query .= " AND tbl_lehreinheit.studiensemester_kurzbz = ?";
|
||||
$params[] = $studiensemester_kurzbz;
|
||||
}
|
||||
|
||||
return $this->execReadOnlyQuery($query, $params);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ class Lvgesamtnote_model extends DB_Model
|
||||
}
|
||||
|
||||
/**
|
||||
* Laedt die Noten
|
||||
* Laedt die Noten - lvgesamtnote (Vorschlag) JOIN tbl.note (zeugnisnote)
|
||||
*
|
||||
* @param integer $lehrveranstaltung_id
|
||||
* @param string $student_uid
|
||||
@@ -50,4 +50,19 @@ class Lvgesamtnote_model extends DB_Model
|
||||
|
||||
return $this->loadWhere($where);
|
||||
}
|
||||
|
||||
public function getLvGesamtNoteVorschlag($lehrveranstaltung_id, $student_uid, $studiensemester_kurzbz)
|
||||
{
|
||||
$qry = "SELECT * FROM campus.tbl_lvgesamtnote
|
||||
WHERE campus.tbl_lvgesamtnote.student_uid = ?
|
||||
AND campus.tbl_lvgesamtnote.studiensemester_kurzbz = ?";
|
||||
$params = [$student_uid, $studiensemester_kurzbz];
|
||||
|
||||
if ($lehrveranstaltung_id) {
|
||||
$qry .= " AND campus.tbl_lvgesamtnote.lehrveranstaltung_id = ?";
|
||||
$params[] = $lehrveranstaltung_id;
|
||||
}
|
||||
|
||||
return $this->execReadOnlyQuery($qry, $params);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,12 +11,33 @@ class Note_model extends DB_Model
|
||||
$this->dbTable = 'lehre.tbl_note';
|
||||
$this->pk = 'note';
|
||||
}
|
||||
|
||||
|
||||
public function getAllActive() {
|
||||
$qry ="SELECT *
|
||||
FROM lehre.tbl_note
|
||||
WHERE aktiv = true";
|
||||
|
||||
return $this->execReadOnlyQuery($qry);
|
||||
}
|
||||
|
||||
// used to determine the primary key of note "entschuldigt" to avoid hardcoded magic numbers
|
||||
// that might differ in a different installation of fhcomplete
|
||||
public function getEntschuldigtNote() {
|
||||
$qry ="SELECT *
|
||||
FROM lehre.tbl_note
|
||||
WHERE bezeichnung = 'entschuldigt'";
|
||||
|
||||
return $this->execReadOnlyQuery($qry);
|
||||
}
|
||||
|
||||
// used to determine the primary key of note "noch nicht eingetragen" to avoid hardcoded magic numbers
|
||||
// that might differ in a different installation of fhcomplete
|
||||
public function getNochNichtEingetragenNote() {
|
||||
$qry ="SELECT *
|
||||
FROM lehre.tbl_note
|
||||
WHERE bezeichnung = 'Noch nicht eingetragen'";
|
||||
|
||||
return $this->execReadOnlyQuery($qry);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -13,7 +13,7 @@ class Notenschluesselaufteilung_model extends DB_Model
|
||||
}
|
||||
|
||||
/**
|
||||
* Liefert die Note zu Punkten einer Lehrveranstaltung
|
||||
* Gives the grade for the points of a course.
|
||||
*
|
||||
* @param number $points
|
||||
* @param integer $lehrveranstaltung_id
|
||||
@@ -23,9 +23,18 @@ class Notenschluesselaufteilung_model extends DB_Model
|
||||
*/
|
||||
public function getNote($points, $lehrveranstaltung_id, $studiensemester_kurzbz)
|
||||
{
|
||||
// Without a valid points value you cannot derive a grade. Without this guard the query
|
||||
// builder makes a bad statement from "punkte <=" => null ('punkte' < 'IS' 'NULL'). The
|
||||
// request then fails with HTTP 500 instead of an answer that says "no grade".
|
||||
if (!is_numeric($points))
|
||||
return success(null);
|
||||
|
||||
$this->load->model('education/Notenschluesselzuordnung_model', 'NotenschluesselzuordnungModel');
|
||||
$notenschluessel_kurzbz = $this->NotenschluesselzuordnungModel->getKurzbzForLv($lehrveranstaltung_id, $studiensemester_kurzbz);
|
||||
|
||||
if($notenschluessel_kurzbz == null)
|
||||
return success(null);
|
||||
|
||||
$this->addSelect("note");
|
||||
$this->addOrder("punkte", "DESC");
|
||||
$this->addLimit(1);
|
||||
|
||||
@@ -60,6 +60,172 @@ class Paabgabe_model extends DB_Model
|
||||
return $this->execReadOnlyQuery($qry, array($person_id));
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets project submissions for search criteria.
|
||||
* @param array $projekttyp_kurzbz_arr contains all relevant project types (e.g. Bachelor)
|
||||
* @param int $studiengang_kz study program
|
||||
* @param string $abgabetyp_kurzbz project submission type (e.g. end upload, intermediate submission)
|
||||
* @param string $abgabedatum due date for hand-in
|
||||
* @param string $personSearchString for searching by person, i.e. name, uid, person/prestudent id
|
||||
* @param int $limit limiting max number of results if search criteria is not precise enough
|
||||
* @return object
|
||||
*/
|
||||
public function getPaAbgaben(
|
||||
$projekttyp_kurzbz_arr,
|
||||
$studiengang_kz = null,
|
||||
$abgabetyp_kurzbz = null,
|
||||
$abgabedatum = null,
|
||||
$personSearchString = null,
|
||||
$limit = 1000
|
||||
) {
|
||||
$params = [];
|
||||
|
||||
$qry = "
|
||||
SELECT
|
||||
stg.bezeichnung AS stgbez, paabg.datum AS termin,
|
||||
paabg.paabgabe_id, paabg.projektarbeit_id, paabg.paabgabetyp_kurzbz, paabg.abgabedatum,
|
||||
abgabetyp.bezeichnung AS paabgabetyp_bezeichnung, ben.uid, pers.vorname, pers.nachname, pa.projekttyp_kurzbz, pa.titel,
|
||||
UPPER(stg.typ || stg.kurzbz) AS studiengang_kuerzel,
|
||||
(
|
||||
/* show all relevant Studiengänge of person and wether it is an employee*/
|
||||
SELECT
|
||||
STRING_AGG(studiengang || ' ' || last_status, ' | ')
|
||||
|| (CASE WHEN EXISTS (
|
||||
SELECT 1 FROM public.tbl_mitarbeiter ma
|
||||
JOIN public.tbl_benutzer ben ON ma.mitarbeiter_uid = ben.uid
|
||||
WHERE person_id = prestudents.person_id
|
||||
AND ben.aktiv
|
||||
) THEN ' | Mitarbeiter' ELSE '' END)
|
||||
FROM (
|
||||
SELECT
|
||||
DISTINCT person_id, prestudent_id, UPPER(stg.typ || stg.kurzbz) AS studiengang,
|
||||
get_rolle_prestudent(ps.prestudent_id, null) AS last_status
|
||||
FROM
|
||||
public.tbl_prestudent ps
|
||||
JOIN public.tbl_studiengang stg USING (studiengang_kz)
|
||||
WHERE
|
||||
person_id = pers.person_id
|
||||
ORDER BY
|
||||
prestudent_id DESC
|
||||
) prestudents
|
||||
WHERE
|
||||
last_status IN ('Abgewiesener','Aufgenommener', 'Student', 'Incoming', 'Diplomand', 'Abbrecher', 'Unterbrecher', 'Absolvent')
|
||||
GROUP BY
|
||||
person_id
|
||||
LIMIT 1;
|
||||
) AS status
|
||||
FROM
|
||||
lehre.tbl_projektarbeit pa
|
||||
JOIN campus.tbl_paabgabe paabg USING(projektarbeit_id)
|
||||
JOIN campus.tbl_paabgabetyp abgabetyp USING(paabgabetyp_kurzbz)
|
||||
LEFT JOIN public.tbl_benutzer ben ON(uid=student_uid)
|
||||
LEFT JOIN public.tbl_person pers ON(ben.person_id=pers.person_id)
|
||||
LEFT JOIN lehre.tbl_lehrveranstaltung USING(lehrveranstaltung_id)
|
||||
LEFT JOIN public.tbl_studiengang stg USING(studiengang_kz)
|
||||
WHERE
|
||||
TRUE";
|
||||
|
||||
if (isset($projekttyp_kurzbz_arr) && !isEmptyArray($projekttyp_kurzbz_arr))
|
||||
{
|
||||
$qry .= " AND projekttyp_kurzbz IN ?";
|
||||
$params[] = $projekttyp_kurzbz_arr;
|
||||
}
|
||||
|
||||
if (isset($studiengang_kz) && is_numeric($studiengang_kz))
|
||||
{
|
||||
$qry .= " AND stg.studiengang_kz=?";
|
||||
$params[] = $studiengang_kz;
|
||||
}
|
||||
|
||||
if (isset($abgabetyp_kurzbz))
|
||||
{
|
||||
$qry .= " AND paabg.paabgabetyp_kurzbz=?";
|
||||
$params[] = $abgabetyp_kurzbz;
|
||||
}
|
||||
|
||||
if (isset($abgabedatum))
|
||||
{
|
||||
$qry .= " AND paabg.datum=?";
|
||||
$params[] = $abgabedatum;
|
||||
}
|
||||
|
||||
if (is_numeric($personSearchString))
|
||||
{
|
||||
$personSearchString = (int) $personSearchString;
|
||||
$params = array_merge($params, [$personSearchString, $personSearchString]);
|
||||
$qry .= " AND (
|
||||
pers.person_id = ?
|
||||
OR EXISTS (SELECT 1 FROM public.tbl_prestudent WHERE person_id = pers.person_id AND prestudent_id = ?)
|
||||
)";
|
||||
}
|
||||
elseif (is_string($personSearchString))
|
||||
{
|
||||
// remove empty spaces and lowercase
|
||||
$personSearchString = strtolower(str_replace(' ', '', $personSearchString));
|
||||
$qry .= " AND (
|
||||
LOWER(REPLACE(pers.nachname || pers.vorname || pers.nachname, ' ', '')) LIKE ".$this->db->escape('%'.$personSearchString.'%')."
|
||||
OR ben.uid LIKE ".$this->db->escape('%'.$personSearchString.'%')."
|
||||
)";
|
||||
}
|
||||
|
||||
$qry .= " ORDER BY nachname";
|
||||
|
||||
if (isset($limit) && is_numeric($limit) && (!isset($studiengang_kz) || !is_numeric($studiengang_kz)) && !isset($abgabedatum))
|
||||
{
|
||||
$qry .= " LIMIT ?";
|
||||
$params[] = $limit;
|
||||
}
|
||||
|
||||
return $this->execReadOnlyQuery($qry, $params);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets due dates for projekt submission search criteria.
|
||||
* @param array $projekttyp_kurzbz_arr contains all relevant project types (e.g. Bachelor)
|
||||
* @param int $studiengang_kz study program
|
||||
* @param string $abgabetyp_kurzbz project submission type (e.g. end upload, intermediate submission)
|
||||
* @return object
|
||||
*/
|
||||
public function getTermine($projekttyp_kurzbz_arr, $studiengang_kz, $abgabetyp_kurzbz)
|
||||
{
|
||||
$params = [];
|
||||
|
||||
$qry = "
|
||||
SELECT
|
||||
DISTINCT tbl_paabgabe.datum as termin, to_char(tbl_paabgabe.datum, 'DD.MM.YYYY') as termin_anzeige
|
||||
FROM
|
||||
lehre.tbl_projektarbeit
|
||||
JOIN campus.tbl_paabgabe USING(projektarbeit_id)
|
||||
LEFT JOIN public.tbl_benutzer ON(uid=student_uid)
|
||||
LEFT JOIN public.tbl_person ON(tbl_benutzer.person_id=tbl_person.person_id)
|
||||
LEFT JOIN lehre.tbl_lehrveranstaltung USING(lehrveranstaltung_id)
|
||||
LEFT JOIN public.tbl_studiengang USING(studiengang_kz)
|
||||
WHERE
|
||||
TRUE";
|
||||
|
||||
if (isset($projekttyp_kurzbz_arr) && !isEmptyArray($projekttyp_kurzbz_arr))
|
||||
{
|
||||
$qry .= " AND projekttyp_kurzbz IN ?";
|
||||
$params[] = $projekttyp_kurzbz_arr;
|
||||
}
|
||||
|
||||
if (isset($studiengang_kz) && is_numeric($studiengang_kz))
|
||||
{
|
||||
$qry .= " AND public.tbl_studiengang.studiengang_kz=?";
|
||||
$params[] = $studiengang_kz;
|
||||
}
|
||||
|
||||
if (isset($abgabetyp_kurzbz))
|
||||
{
|
||||
$qry .= " AND campus.tbl_paabgabe.paabgabetyp_kurzbz=?";
|
||||
$params[] = $abgabetyp_kurzbz;
|
||||
}
|
||||
|
||||
$qry .= " ORDER BY termin DESC";
|
||||
|
||||
return $this->execReadOnlyQuery($qry, $params);
|
||||
}
|
||||
|
||||
public function findAbgabenNewOrUpdatedSince($interval, $relevantTypes)
|
||||
{
|
||||
|
||||
|
||||
@@ -23,8 +23,10 @@ class Projektarbeit_model extends DB_Model
|
||||
*/
|
||||
public function getProjektarbeit($student_uid, $studiengang_kz = null, $studiensemester_kurzbz = null, $projekttyp = null, $final = null)
|
||||
{
|
||||
$sprache_index = "COALESCE((SELECT index FROM public.tbl_sprache WHERE sprache=" . $this->escape(getUserLanguage()) . " LIMIT 1), 1)";
|
||||
$qry = "SELECT
|
||||
pa.*, tbl_projekttyp.bezeichnung,
|
||||
pa.*, tbl_projekttyp.bezeichnung, tbl_lehrveranstaltung.lehrveranstaltung_id,
|
||||
tbl_sprache.bezeichnung[".$sprache_index."] AS sprache_bezeichnung,
|
||||
pa.studiensemester_kurzbz, pa.lehrveranstaltung_id,
|
||||
tbl_firma.name AS firma_name,
|
||||
(
|
||||
@@ -43,6 +45,7 @@ class Projektarbeit_model extends DB_Model
|
||||
JOIN lehre.tbl_projekttyp USING (projekttyp_kurzbz)
|
||||
JOIN lehre.tbl_lehrveranstaltung USING (lehrveranstaltung_id)
|
||||
LEFT JOIN public.tbl_firma USING (firma_id)
|
||||
LEFT JOIN public.tbl_sprache ON pa.sprache = tbl_sprache.sprache
|
||||
WHERE
|
||||
pa.student_uid = ?";
|
||||
|
||||
|
||||
@@ -306,4 +306,5 @@ class Pruefung_model extends DB_Model
|
||||
|
||||
return $this->loadWhereCommitteeExamsFailed();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -515,4 +515,75 @@ class Studierendenantrag_model extends DB_Model
|
||||
|
||||
return hasData($this->load());
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads all todos for a certain studiengangsleiter
|
||||
*
|
||||
* @param integer $stg_kz
|
||||
*
|
||||
* @return stdClass
|
||||
*/
|
||||
public function getOpenAntraegeForStgl($stg_kz)
|
||||
{
|
||||
$qry = "
|
||||
SELECT
|
||||
studierendenantrag_id,
|
||||
prestudent_id,
|
||||
typ,
|
||||
person.nachname,
|
||||
person.vorname,
|
||||
ps.studiengang_kz
|
||||
FROM campus.tbl_studierendenantrag a
|
||||
JOIN public.tbl_prestudent ps USING (prestudent_id)
|
||||
JOIN public.tbl_person person USING (person_id)
|
||||
WHERE studiengang_kz in ?
|
||||
AND (
|
||||
(typ IN ('Abmeldung', 'AbmeldungStgl', 'Unterbrechung')
|
||||
AND campus.get_status_studierendenantrag(a.studierendenantrag_id) = 'Erstellt')
|
||||
OR
|
||||
(typ = 'Wiederholung'
|
||||
AND campus.get_status_studierendenantrag(a.studierendenantrag_id) = 'Lvszugewiesen')
|
||||
)
|
||||
ORDER BY typ;
|
||||
";
|
||||
|
||||
$params = array($stg_kz);
|
||||
return $this->execQuery($qry, $params);
|
||||
}
|
||||
|
||||
/**
|
||||
* Lists all open antraege for a certain stg
|
||||
*
|
||||
* @param Array $stg_kz
|
||||
*
|
||||
* @return stdClass
|
||||
*/
|
||||
public function getOpenAntraegeForAss($stg_kz)
|
||||
{
|
||||
$qry = "
|
||||
SELECT
|
||||
UPPER(stg.typ) || UPPER(stg.kurzbz) || ' ' || stg.bezeichnung AS studiengang,
|
||||
COUNT(*) AS anzahl
|
||||
FROM campus.tbl_studierendenantrag
|
||||
JOIN public.tbl_prestudent p USING (prestudent_id)
|
||||
JOIN public.tbl_studiengang stg ON p.studiengang_kz=stg.studiengang_kz
|
||||
JOIN campus.tbl_studierendenantrag_status as s ON campus.get_status_id_studierendenantrag(campus.tbl_studierendenantrag.studierendenantrag_id) = studierendenantrag_status_id
|
||||
JOIN campus.tbl_studierendenantrag_statustyp as st USING (studierendenantrag_statustyp_kurzbz)
|
||||
WHERE (
|
||||
s.studierendenantrag_statustyp_kurzbz NOT IN('Zurueckgezogen', 'Genehmigt', 'Abgelehnt', 'EinspruchAbgelehnt', 'Abgemeldet', 'Pause', 'EmailVersandt')
|
||||
OR (
|
||||
s.studierendenantrag_statustyp_kurzbz = 'Genehmigt'
|
||||
AND tbl_studierendenantrag.typ = 'AbmeldungStgl'
|
||||
)
|
||||
)
|
||||
AND p.studiengang_kz IN ?
|
||||
GROUP BY studiengang
|
||||
ORDER BY studiengang
|
||||
"
|
||||
;
|
||||
|
||||
$params = array($stg_kz);
|
||||
return $this->execQuery($qry, $params);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -653,31 +653,42 @@ class Studiengang_model extends DB_Model
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the Studiengang information. Without parameters it uses the Studiengang
|
||||
* of the logged in Student.
|
||||
*
|
||||
* @param int|null $studiengang_kz
|
||||
* @param int|null $semester used for the Jahrgangsvertretung
|
||||
* @return stdClass
|
||||
*/
|
||||
public function getStudiengangInfoForNews()
|
||||
public function getStudiengangInfoForNews($studiengang_kz = null, $semester = null)
|
||||
{
|
||||
|
||||
$this->load->model('person/Benutzerfunktion_model', 'BenutzerfunktionModel');
|
||||
$this->load->model('person/Person_model', 'PersonModel');
|
||||
$this->load->model('crm/Student_model', 'StudentModel');
|
||||
|
||||
$student = $this->StudentModel->loadWhere(['student_uid' => getAuthUID()]);
|
||||
if (isError($student))
|
||||
return error($student);
|
||||
if (getData($student)) {
|
||||
$student = current(getData($student));
|
||||
$studiengang_kz = $student->studiengang_kz;
|
||||
$semester = $student->semester;
|
||||
|
||||
if (is_null($studiengang_kz))
|
||||
{
|
||||
$student = $this->StudentModel->loadWhere(['student_uid' => getAuthUID()]);
|
||||
if (isError($student))
|
||||
return error($student);
|
||||
if (getData($student)) {
|
||||
$student = current(getData($student));
|
||||
$studiengang_kz = $student->studiengang_kz;
|
||||
$semester = $student->semester;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// users without a Student record get no information instead of an error
|
||||
if (is_null($studiengang_kz))
|
||||
return success(null);
|
||||
|
||||
$stg_obj = $this->load($studiengang_kz);
|
||||
if(isError($stg_obj))
|
||||
return error($stg_obj);
|
||||
if(getData($stg_obj))
|
||||
{
|
||||
$stg_obj = current(getData($stg_obj));
|
||||
}
|
||||
if(!hasData($stg_obj))
|
||||
return error('Studiengang nicht gefunden');
|
||||
$stg_obj = current(getData($stg_obj));
|
||||
|
||||
$stg_ltg = $this->getLeitungDetailed($stg_obj->studiengang_kz);
|
||||
if (isError($stg_ltg))
|
||||
@@ -886,6 +897,14 @@ class Studiengang_model extends DB_Model
|
||||
return success($ass);
|
||||
}
|
||||
|
||||
public function getDegreePrograms() {
|
||||
$query = "SELECT *
|
||||
FROM public.tbl_studiengang
|
||||
ORDER BY public.tbl_studiengang.kurzbzlang";
|
||||
|
||||
return $this->execReadOnlyQuery($query);
|
||||
}
|
||||
|
||||
private function addEmailProperty(&$benutzerfunktionen) {
|
||||
if(count($benutzerfunktionen) && defined('DOMAIN'))
|
||||
{
|
||||
|
||||
@@ -59,6 +59,37 @@ class Studienplan_model extends DB_Model
|
||||
'tbl_studienplan_lehrveranstaltung.semester' => $semester
|
||||
));
|
||||
}
|
||||
|
||||
public function getStudienplanByLvaSemKurzbz($lehrveranstaltung_id, $studiensemester_kurzbz) {
|
||||
$qry= "
|
||||
SELECT
|
||||
DISTINCT tbl_studienplan.*
|
||||
FROM
|
||||
lehre.tbl_studienplan
|
||||
JOIN lehre.tbl_studienplan_lehrveranstaltung
|
||||
USING(studienplan_id)
|
||||
WHERE
|
||||
tbl_studienplan_lehrveranstaltung.lehrveranstaltung_id IN (
|
||||
SELECT
|
||||
lv.lehrveranstaltung_id
|
||||
FROM
|
||||
lehre.tbl_lehrveranstaltung AS lv
|
||||
LEFT JOIN lehre.tbl_lehrveranstaltung AS t ON t.lehrveranstaltung_id=lv.lehrveranstaltung_template_id
|
||||
WHERE
|
||||
lv.lehrtyp_kurzbz<>'tpl'
|
||||
AND (lv.lehrveranstaltung_id= ? OR (lv.lehrveranstaltung_template_id= ? AND t.lehrtyp_kurzbz='tpl'))
|
||||
)
|
||||
AND EXISTS (
|
||||
SELECT 1
|
||||
FROM
|
||||
lehre.tbl_studienplan_semester
|
||||
WHERE studienplan_id=tbl_studienplan.studienplan_id
|
||||
AND studiensemester_kurzbz= ?
|
||||
AND semester = tbl_studienplan_lehrveranstaltung.semester)
|
||||
ORDER BY bezeichnung";
|
||||
|
||||
return $this->execReadOnlyQuery($qry, array($lehrveranstaltung_id, $lehrveranstaltung_id, $studiensemester_kurzbz));
|
||||
}
|
||||
|
||||
public function getStudienplanLehrveranstaltungForPrestudent($studienplan_id, $semester, $prestudent_id)
|
||||
{
|
||||
|
||||
@@ -375,6 +375,30 @@ EOSQL;
|
||||
return $this->loadWhere(['uid' => $student_uid, 'v.lehre' => true]);
|
||||
}
|
||||
|
||||
public function getWhereMitarbeiterHasLvs($uid) {
|
||||
// first order by year with last 2 letter from right,
|
||||
// then order by WS/SS inside the years
|
||||
// query it asc so the ordering magic in cis4 turns it around again
|
||||
$qry = "WITH unique_semesters AS (
|
||||
SELECT DISTINCT ON (studiensemester_kurzbz)
|
||||
studiensemester_kurzbz,
|
||||
start,
|
||||
ende,
|
||||
bezeichnung,
|
||||
studienjahr_kurzbz
|
||||
FROM lehre.tbl_lehreinheit
|
||||
JOIN lehre.tbl_lehreinheitmitarbeiter USING(lehreinheit_id)
|
||||
JOIN public.tbl_studiensemester USING(studiensemester_kurzbz)
|
||||
WHERE mitarbeiter_uid = ?
|
||||
)
|
||||
SELECT * FROM unique_semesters
|
||||
ORDER BY
|
||||
RIGHT(studiensemester_kurzbz, 2) ASC,
|
||||
LEFT(studiensemester_kurzbz, 2) ASC;";
|
||||
|
||||
return $this->execReadOnlyQuery($qry, [$uid]);
|
||||
}
|
||||
|
||||
public function getAktAndFutureSemester()
|
||||
{
|
||||
$query = 'SELECT studiensemester_kurzbz
|
||||
|
||||
@@ -319,6 +319,40 @@ class Benutzerfunktion_model extends DB_Model
|
||||
return $record;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get active Assistenz(en) of the user by UID.
|
||||
* @param $uid
|
||||
*/
|
||||
public function getSTGAssByUID($uid)
|
||||
{
|
||||
$query = '
|
||||
SELECT
|
||||
uid,
|
||||
oe_kurzbz,
|
||||
studiengang_kz,
|
||||
typ,
|
||||
tbl_studiengang.bezeichnung
|
||||
FROM
|
||||
public.tbl_benutzerfunktion
|
||||
JOIN public.tbl_studiengang USING (oe_kurzbz)
|
||||
WHERE
|
||||
funktion_kurzbz = \'ass\'
|
||||
AND (datum_von IS NULL OR datum_von <= now())
|
||||
AND (datum_bis IS NULL OR datum_bis >= now())
|
||||
AND uid = ?
|
||||
ORDER BY
|
||||
oe_kurzbz
|
||||
';
|
||||
|
||||
$parameters_array = array();
|
||||
if (is_string($uid))
|
||||
{
|
||||
$parameters_array[] = $uid;
|
||||
}
|
||||
|
||||
return $this->execQuery($query, $parameters_array);
|
||||
}
|
||||
|
||||
function updateBenutzerfunktion($funktionJson)
|
||||
{
|
||||
$funktionJson['updatevon'] = getAuthUID();
|
||||
|
||||
@@ -12,6 +12,12 @@ class Ort_model extends DB_Model
|
||||
$this->pk = "ort_kurzbz";
|
||||
}
|
||||
|
||||
public function getRoomInfo($ortKurzbz)
|
||||
{
|
||||
$this->addSelect("ort_kurzbz, ausstattung");
|
||||
return $this->OrtModel->loadWhere(array("ort_kurzbz" => $ortKurzbz));
|
||||
}
|
||||
|
||||
public function getAll($raumtyp_kurzbz)
|
||||
{
|
||||
$this->addOrder("ort_kurzbz");
|
||||
|
||||
@@ -24,7 +24,7 @@ class Reservierung_model extends DB_Model
|
||||
$lvplan_reservierungen_query = "SELECT r.* , stund.beginn, stund.ende,
|
||||
CASE
|
||||
WHEN r.gruppe_kurzbz IS NOT NULL THEN r.gruppe_kurzbz
|
||||
ELSE CONCAT(UPPER(studg.typ),UPPER(studg.kurzbz),'-',COALESCE(CAST(r.semester AS varchar),'/'),COALESCE(CAST(r.verband AS varchar),'/'))
|
||||
ELSE CONCAT(UPPER(studg.typ),UPPER(studg.kurzbz),'-',COALESCE(CAST(r.semester AS varchar),'/'),COALESCE(CAST(r.verband AS varchar),'/'),COALESCE(CAST(r.gruppe AS varchar),'/'))
|
||||
END as gruppen_kuerzel
|
||||
FROM campus.vw_reservierung r
|
||||
JOIN public.tbl_studiengang studg ON studg.studiengang_kz=r.studiengang_kz
|
||||
@@ -39,7 +39,7 @@ class Reservierung_model extends DB_Model
|
||||
$raum_reservierungen_query = "SELECT res.*, beginn, ende,
|
||||
CASE
|
||||
WHEN res.gruppe_kurzbz IS NOT NULL THEN res.gruppe_kurzbz
|
||||
ELSE CONCAT(UPPER(studg.typ),UPPER(studg.kurzbz),'-',COALESCE(CAST(res.semester AS varchar),'/'),COALESCE(CAST(res.verband AS varchar),'/'))
|
||||
ELSE CONCAT(UPPER(studg.typ),UPPER(studg.kurzbz),'-',COALESCE(CAST(res.semester AS varchar),'/'),COALESCE(CAST(res.verband AS varchar),'/'),COALESCE(CAST(res.gruppe AS varchar),'/'))
|
||||
END as gruppen_kuerzel
|
||||
FROM campus.vw_reservierung res
|
||||
JOIN public.tbl_studiengang studg ON studg.studiengang_kz=res.studiengang_kz
|
||||
@@ -50,11 +50,12 @@ class Reservierung_model extends DB_Model
|
||||
|
||||
$query_result = $this->execReadOnlyQuery("
|
||||
SELECT
|
||||
'reservierung' as type, beginn, ende, datum,
|
||||
DISTINCT(insertvon),
|
||||
'reservierung' as type, beginn, ende, datum, array_agg(DISTINCT reservierung_id) AS reservierung_id,
|
||||
COALESCE(titel, beschreibung) as topic,
|
||||
array_agg(DISTINCT mitarbeiter_kurzbz) as lektor,
|
||||
array_agg(DISTINCT (gruppe,verband,semester,studiengang_kz,gruppen_kuerzel)) as gruppe,
|
||||
|
||||
array_agg(DISTINCT(uid)) as uids,
|
||||
ort_kurzbz, 'FFFFFF' as farbe
|
||||
|
||||
FROM
|
||||
@@ -62,7 +63,7 @@ class Reservierung_model extends DB_Model
|
||||
" . $subquery . "
|
||||
) AS subquery
|
||||
|
||||
GROUP BY datum, beginn, ende, ort_kurzbz, titel, beschreibung
|
||||
GROUP BY datum, beginn, ende, ort_kurzbz, titel, beschreibung, insertvon
|
||||
|
||||
ORDER BY datum, beginn
|
||||
", is_null($ort_kurzbz) ? [$uid ?? getAuthUID(), $uid ?? getAuthUID(), $start_date, $end_date] : [$ort_kurzbz, $start_date, $end_date]);
|
||||
@@ -82,7 +83,7 @@ class Reservierung_model extends DB_Model
|
||||
$raum_reservierungen_query = "SELECT res.*, beginn, ende,
|
||||
CASE
|
||||
WHEN res.gruppe_kurzbz IS NOT NULL THEN res.gruppe_kurzbz
|
||||
ELSE CONCAT(UPPER(studg.typ),UPPER(studg.kurzbz),'-',COALESCE(CAST(res.semester AS varchar),'/'),COALESCE(CAST(res.verband AS varchar),'/'))
|
||||
ELSE CONCAT(UPPER(studg.typ),UPPER(studg.kurzbz),'-',COALESCE(CAST(res.semester AS varchar),'/'),COALESCE(CAST(res.verband AS varchar),'/'),COALESCE(CAST(res.gruppe AS varchar),'/'))
|
||||
END as gruppen_kuerzel
|
||||
FROM campus.vw_reservierung res
|
||||
JOIN public.tbl_studiengang studg ON studg.studiengang_kz=res.studiengang_kz
|
||||
@@ -94,11 +95,12 @@ class Reservierung_model extends DB_Model
|
||||
|
||||
$query_result = $this->execReadOnlyQuery("
|
||||
SELECT
|
||||
'reservierung' as type, beginn, ende, datum,
|
||||
DISTINCT(insertvon),
|
||||
'reservierung' as type, beginn, ende, datum, array_agg(DISTINCT reservierung_id) AS reservierung_id,
|
||||
COALESCE(titel, beschreibung) as topic,
|
||||
array_agg(DISTINCT mitarbeiter_kurzbz) as lektor,
|
||||
array_agg(DISTINCT (gruppe,verband,semester,studiengang_kz,gruppen_kuerzel)) as gruppe,
|
||||
|
||||
array_agg(DISTINCT(uid)) as uids,
|
||||
ort_kurzbz, 'FFFFFF' as farbe
|
||||
|
||||
FROM
|
||||
@@ -106,7 +108,7 @@ class Reservierung_model extends DB_Model
|
||||
" . $subquery . "
|
||||
) AS subquery
|
||||
|
||||
GROUP BY datum, beginn, ende, ort_kurzbz, titel, beschreibung
|
||||
GROUP BY datum, beginn, ende, ort_kurzbz, titel, beschreibung, insertvon
|
||||
|
||||
ORDER BY datum, beginn
|
||||
", [$uid ?? getAuthUID(), $start_date, $end_date]);
|
||||
@@ -146,4 +148,40 @@ class Reservierung_model extends DB_Model
|
||||
return $this->execReadOnlyQuery($qry, [$uid, $datum, $stunde]);
|
||||
}
|
||||
|
||||
public function deleteReservation($reservierung_id) {
|
||||
$uid = getAuthUID();
|
||||
|
||||
$result = $this->load($reservierung_id);
|
||||
|
||||
if (isError($result))
|
||||
return $result;
|
||||
|
||||
if (!hasData($result))
|
||||
return error('Reservierung nicht gefunden');
|
||||
|
||||
$row = $result->retval[0];
|
||||
|
||||
if ($row->uid !== $uid && $row->insertvon !== $uid)
|
||||
return error('Keine Berechtigung');
|
||||
|
||||
return $this->delete($reservierung_id);
|
||||
}
|
||||
|
||||
public function getMyReservation() {
|
||||
$uid = getAuthUID();
|
||||
$date = date("Y-m-d",time());
|
||||
|
||||
$qry = "SELECT vw_reservierung.*,
|
||||
trim(COALESCE(vw_mitarbeiter.titelpre,'')||' '||COALESCE(vw_mitarbeiter.vorname,'')||' '||COALESCE(vw_mitarbeiter.nachname,'')||' '||COALESCE(vw_mitarbeiter.titelpost,'')) as reserviert_fuer,
|
||||
trim(COALESCE(reserviert_von.titelpre,'')||' '||COALESCE(reserviert_von.vorname,'')||' '||COALESCE(reserviert_von.nachname,'')||' '||COALESCE(reserviert_von.titelpost,'')) as reserviert_von
|
||||
FROM campus.vw_reservierung
|
||||
JOIN campus.vw_mitarbeiter ON vw_reservierung.uid=vw_mitarbeiter.uid
|
||||
LEFT JOIN campus.vw_mitarbeiter reserviert_von ON vw_reservierung.insertvon=reserviert_von.uid
|
||||
WHERE datum >= ?
|
||||
AND (vw_reservierung.uid= ? OR vw_reservierung.insertvon= ? )
|
||||
ORDER BY datum, titel, ort_kurzbz, stunde";
|
||||
|
||||
return $this->execReadOnlyQuery($qry, [$date, $uid, $uid]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -12,6 +12,8 @@ class Zeitsperre_model extends DB_Model
|
||||
$this->pk = 'zeitsperre_id';
|
||||
}
|
||||
|
||||
const BLOCKIERENDE_ZEITSPERREN = ['Krank','Urlaub','ZA','DienstV','PflegeU','DienstF','CovidSB','CovidKS'];
|
||||
|
||||
/**
|
||||
* Save or update Zeitsperre.
|
||||
*
|
||||
@@ -62,6 +64,270 @@ class Zeitsperre_model extends DB_Model
|
||||
return $this->execQuery($qry);
|
||||
}
|
||||
|
||||
/**
|
||||
* get Zeitsperren of a user
|
||||
*
|
||||
* @param $uid mitarbeiteruid
|
||||
* @param $bisgrenze @true show only entries of actual business year (1.9.- 31.8.)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getZeitsperrenUser($uid, $bisgrenze = true)
|
||||
{
|
||||
$qry = "
|
||||
SELECT
|
||||
tbl_zeitsperre.*, tbl_zeitsperretyp.*, tbl_erreichbarkeit.farbe AS erreichbarkeit_farbe,
|
||||
tbl_erreichbarkeit.beschreibung AS erreichbarkeit_beschreibung,
|
||||
CONCAT (ps.vorname, ' ', ps.nachname) as vertretung
|
||||
FROM (campus.tbl_zeitsperre JOIN campus.tbl_zeitsperretyp USING (zeitsperretyp_kurzbz))
|
||||
LEFT JOIN campus.tbl_erreichbarkeit USING (erreichbarkeit_kurzbz)
|
||||
LEFT JOIN public.tbl_benutzer ON campus.tbl_zeitsperre.vertretung_uid = public.tbl_benutzer.uid
|
||||
LEFT JOIN public.tbl_person ps USING (person_id)
|
||||
WHERE mitarbeiter_uid= ?
|
||||
";
|
||||
|
||||
if($bisgrenze)
|
||||
{
|
||||
$qry.="
|
||||
AND (
|
||||
(date_part('month',vondatum)>=9 AND date_part('year', vondatum)>='".(date('Y')-1)."')
|
||||
OR
|
||||
(date_part('month',vondatum)<9 AND date_part('year', vondatum)>='".(date('Y'))."')
|
||||
)";
|
||||
}
|
||||
|
||||
$qry.= " ORDER BY vondatum DESC";
|
||||
|
||||
return $this->execQuery($qry, array('mitarbeiter_uid' => $uid));
|
||||
}
|
||||
|
||||
/**
|
||||
* check a date for existing zeitsperre
|
||||
*
|
||||
* @param $uid mitarbeiteruid
|
||||
* @param $datum datum to check
|
||||
* @param $stunde stunde (default = null)
|
||||
* @param bool $nurblockierend if only hr relevante zeitsperren have to be checked
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getSperreByDate($uid, $datum, $stunde = null, $nurblockierend = false)
|
||||
{
|
||||
$parametersArray = [$datum, $datum];
|
||||
|
||||
$qry = "
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
campus.tbl_zeitsperre
|
||||
WHERE
|
||||
vondatum <= ?
|
||||
AND bisdatum>= ?";
|
||||
|
||||
if($nurblockierend)
|
||||
{
|
||||
$qry .= " AND zeitsperretyp_kurzbz IN ('"
|
||||
. implode("','", self::BLOCKIERENDE_ZEITSPERREN)
|
||||
. "')";
|
||||
}
|
||||
|
||||
if(!is_null($stunde))
|
||||
{
|
||||
$parametersArray = array_merge(
|
||||
$parametersArray,
|
||||
[$datum, $stunde, $datum, $datum, $stunde, $datum]
|
||||
);
|
||||
|
||||
$qry.=" AND
|
||||
((vondatum= ? AND vonstunde<= ? OR vonstunde is null OR vondatum<> ?) AND
|
||||
(bisdatum= ? AND bisstunde>= ? OR bisstunde is null OR bisdatum<> ?))";
|
||||
}
|
||||
|
||||
array_push($parametersArray, $uid);
|
||||
|
||||
$qry .= "AND mitarbeiter_uid= ? ";
|
||||
|
||||
return $this->execQuery($qry, $parametersArray);
|
||||
}
|
||||
|
||||
/**
|
||||
* check a date for existing zeitsperre
|
||||
*
|
||||
* @param $uid mitarbeiteruid
|
||||
* @param $vondatum datum in Format IS0
|
||||
* @param $bisdatum datum in Format ISO
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function existsZeitaufzeichnung($uid, $vonDay, $bisDay)
|
||||
{
|
||||
try {
|
||||
$from = new DateTime($vonDay);
|
||||
$to = new DateTime($bisDay);
|
||||
} catch (Exception $e) {
|
||||
throw new Exception("Invalid date format");
|
||||
}
|
||||
|
||||
//remove hour stamps
|
||||
$from->setTime(0, 0, 0);
|
||||
$to->setTime(0, 0, 0)->modify('+1 day');
|
||||
|
||||
$fromSql = $from->format('Y-m-d');
|
||||
$toSql = $to->format('Y-m-d');
|
||||
$params = [$uid, $fromSql, $toSql];
|
||||
|
||||
$qry = "
|
||||
SELECT *
|
||||
FROM campus.tbl_zeitaufzeichnung
|
||||
WHERE uid = ?
|
||||
AND start >= ?
|
||||
AND ende < ? ";
|
||||
|
||||
$result = $this->execQuery($qry, $params);
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* getZeitsperren of Mitarbeiter for the next days
|
||||
* @ days: count of the intervall of the next days
|
||||
* @return array
|
||||
*/
|
||||
public function getZeitsperrenForNextDays($days, $uid=null)
|
||||
{
|
||||
$von = date('Y-m-d');
|
||||
$bis = date('Y-m-d', strtotime("+{$days} days"));
|
||||
|
||||
$paramsArray = [$von, $bis, $bis, $von];
|
||||
|
||||
if($uid)
|
||||
$paramsArray[] = $uid;
|
||||
|
||||
$qry = "select
|
||||
nachname,
|
||||
vorname,
|
||||
uid,
|
||||
vondatum,
|
||||
bisdatum,
|
||||
vertretung_uid,
|
||||
erreichbarkeit_kurzbz,
|
||||
mv.kurzbz
|
||||
from
|
||||
campus.vw_mitarbeiter
|
||||
join campus.tbl_zeitsperre on
|
||||
(uid = mitarbeiter_uid)
|
||||
left join public.tbl_mitarbeiter mv on campus.tbl_zeitsperre.vertretung_uid = mv.mitarbeiter_uid
|
||||
where
|
||||
((? <= bisdatum
|
||||
and ? >= bisdatum)
|
||||
or (?>= vondatum
|
||||
and ? <= vondatum))";
|
||||
|
||||
if($uid)
|
||||
$qry .= " and uid = ? ";
|
||||
|
||||
$qry .= "
|
||||
order by nachname
|
||||
";
|
||||
|
||||
$result = $this->execQuery($qry, $paramsArray);
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function getMitarbeiterWithZeitsperren($von, $bis, $fix=false, $lector=false, $oe=null, $ass=false, $stg=false)
|
||||
{
|
||||
$paramsArray = [$von, $bis, $bis, $von];
|
||||
|
||||
if($oe)
|
||||
{
|
||||
$paramsArray[] = $oe;
|
||||
}
|
||||
|
||||
if($stg)
|
||||
{
|
||||
$paramsArray[] = $stg;
|
||||
}
|
||||
|
||||
$qry = "
|
||||
SELECT
|
||||
m.nachname,
|
||||
m.vorname,
|
||||
m.uid,
|
||||
z.vondatum,
|
||||
z.bisdatum,
|
||||
z.vertretung_uid,
|
||||
z.erreichbarkeit_kurzbz,
|
||||
m.lektor,
|
||||
m.fixangestellt,
|
||||
mv.kurzbz
|
||||
FROM campus.vw_mitarbeiter m
|
||||
join public.tbl_benutzer bn on bn.uid = m.uid";
|
||||
|
||||
if($oe || $ass || $stg)
|
||||
{
|
||||
$qry .= " JOIN public.tbl_benutzerfunktion bf on bf.uid = bn.uid";
|
||||
}
|
||||
|
||||
if($stg)
|
||||
{
|
||||
$qry .= " JOIN public.tbl_studiengang stg using (oe_kurzbz)";
|
||||
}
|
||||
|
||||
$qry.= "
|
||||
LEFT JOIN campus.tbl_zeitsperre z
|
||||
ON m.uid = z.mitarbeiter_uid
|
||||
AND (
|
||||
(? <= z.bisdatum AND ? >= z.bisdatum)
|
||||
OR
|
||||
(? >= z.vondatum AND ? <= z.vondatum)
|
||||
)
|
||||
left join public.tbl_mitarbeiter mv on z.vertretung_uid = mv.mitarbeiter_uid
|
||||
where bn.aktiv = true
|
||||
";
|
||||
|
||||
|
||||
if($fix) {
|
||||
$qry.= " AND m.fixangestellt = true";
|
||||
}
|
||||
if($lector) {
|
||||
$qry.= " AND m.lektor = true";
|
||||
}
|
||||
|
||||
if ($oe)
|
||||
{
|
||||
$qry.= "
|
||||
AND bf.funktion_kurzbz ='oezuordnung'
|
||||
AND bf.oe_kurzbz= ?
|
||||
AND (bf.datum_von is null or bf.datum_von <=now())
|
||||
AND (bf.datum_bis is null or bf.datum_bis >= now())
|
||||
";
|
||||
}
|
||||
|
||||
if ($ass)
|
||||
{
|
||||
$qry.= "
|
||||
AND bf.funktion_kurzbz ='ass'
|
||||
AND (bf.datum_von is null or bf.datum_von <=now())
|
||||
AND (bf.datum_bis is null or bf.datum_bis >= now())
|
||||
";
|
||||
}
|
||||
|
||||
if ($stg)
|
||||
{
|
||||
$qry.= "
|
||||
AND stg.studiengang_kz = ?
|
||||
";
|
||||
}
|
||||
|
||||
$qry .= " order by nachname, vorname, uid";
|
||||
|
||||
|
||||
$result = $this->execQuery($qry, $paramsArray);
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function checkIfZeitsperreExists($uid, $datum, $stunde)
|
||||
{
|
||||
$this->db->select("*");
|
||||
@@ -71,30 +337,29 @@ class Zeitsperre_model extends DB_Model
|
||||
|
||||
$this->db->group_start();
|
||||
|
||||
$this->db->where('vondatum <', $datum);
|
||||
$this->db->or_group_start();
|
||||
$this->db->where('vondatum', $datum);
|
||||
$this->db->group_start();
|
||||
$this->db->where('vonstunde <=', $stunde);
|
||||
$this->db->or_where('vonstunde IS NULL', null, false);
|
||||
$this->db->group_end();
|
||||
$this->db->group_end();
|
||||
$this->db->where('vondatum <', $datum);
|
||||
$this->db->or_group_start();
|
||||
$this->db->where('vondatum', $datum);
|
||||
$this->db->group_start();
|
||||
$this->db->where('vonstunde <=', $stunde);
|
||||
$this->db->or_where('vonstunde IS NULL', null, false);
|
||||
$this->db->group_end();
|
||||
$this->db->group_end();
|
||||
$this->db->group_end();
|
||||
|
||||
|
||||
$this->db->group_start();
|
||||
$this->db->where('bisdatum >', $datum);
|
||||
$this->db->or_group_start();
|
||||
$this->db->where('bisdatum', $datum);
|
||||
$this->db->group_start();
|
||||
$this->db->where('bisstunde >=', $stunde);
|
||||
$this->db->or_where('bisstunde IS NULL', null, false);
|
||||
$this->db->group_end();
|
||||
$this->db->where('bisdatum >', $datum);
|
||||
$this->db->or_group_start();
|
||||
$this->db->where('bisdatum', $datum);
|
||||
$this->db->group_start();
|
||||
$this->db->where('bisstunde >=', $stunde);
|
||||
$this->db->or_where('bisstunde IS NULL', null, false);
|
||||
$this->db->group_end();
|
||||
|
||||
$this->db->group_end();
|
||||
$this->db->group_end();
|
||||
$this->db->group_end();
|
||||
|
||||
return $this->load();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,4 +11,20 @@ class Zeitsperretyp_model extends DB_Model
|
||||
$this->dbTable = 'campus.tbl_zeitsperretyp';
|
||||
$this->pk = 'zeitsperretyp_kurzbz';
|
||||
}
|
||||
|
||||
public function getTypenZeitsperren($excludedTypes = [])
|
||||
{
|
||||
$whereNotClause = "";
|
||||
if (count($excludedTypes)) {
|
||||
$excludedTypes = array_map(
|
||||
function ($type) {
|
||||
return "'$type'";
|
||||
},
|
||||
$excludedTypes
|
||||
);
|
||||
$excludedTypes = implode(", ", $excludedTypes);
|
||||
$whereNotClause = "WHERE NOT zeitsperretyp_kurzbz IN ($excludedTypes)";
|
||||
}
|
||||
return $this->execQuery("SELECT * FROM $this->dbTable $whereNotClause ORDER BY beschreibung ASC");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ $includesArray = array(
|
||||
'primevue3' => true,
|
||||
'skipID' => '#fhccontent',
|
||||
'vuedatepicker11' => true,
|
||||
'tinymce5' => true,
|
||||
'customCSSs' => array(
|
||||
'public/css/components/verticalsplit.css',
|
||||
'public/css/components/searchbar/searchbar.css',
|
||||
@@ -21,9 +22,14 @@ $includesArray = array(
|
||||
'public/css/components/FilterComponent.css',
|
||||
'public/css/components/Profil.css',
|
||||
'public/css/components/FormUnderline.css',
|
||||
'public/css/components/inViewTooltip.css',
|
||||
'public/css/components/abgabetool/abgabe.css',
|
||||
'public/css/Cis4/Cms.css',
|
||||
'public/css/Cis4/Studium.css'
|
||||
'public/css/Cis4/Studium.css',
|
||||
'public/css/components/vue-datepicker.css',
|
||||
'public/css/Cis4/Benotungstool.css',
|
||||
'public/css/components/Zeitsperrenma.css', //70747
|
||||
'public/css/Cis4/Zeitsperren.css', //77941
|
||||
),
|
||||
'customJSs' => array(
|
||||
'vendor/npm-asset/primevue/accordion/accordion.min.js',
|
||||
@@ -37,11 +43,15 @@ $includesArray = array(
|
||||
'vendor/npm-asset/primevue/timeline/timeline.min.js',
|
||||
'vendor/npm-asset/primevue/inplace/inplace.min.js',
|
||||
'vendor/npm-asset/primevue/message/message.min.js',
|
||||
'vendor/npm-asset/primevue/divider/divider.min.js',
|
||||
'vendor/npm-asset/primevue/password/password.js',
|
||||
'vendor/npm-asset/primevue/multiselect/multiselect.js',
|
||||
'vendor/npm-asset/primevue/tieredmenu/tieredmenu.js',
|
||||
'vendor/moment/luxonjs/luxon.min.js'
|
||||
),
|
||||
'customJSModules' => array(
|
||||
'public/js/apps/Cis/Cis.js',
|
||||
'vendor/olifolkerd/tabulator5/src/js/modules/ColumnCalcs/ColumnCalcs.js'
|
||||
),
|
||||
|
||||
);
|
||||
@@ -49,6 +59,8 @@ $includesArray = array(
|
||||
$this->load->view('templates/CISVUE-Header', $includesArray);
|
||||
?>
|
||||
<div id="fhccontent" class="h-100" route=<?php echo $route ?>>
|
||||
<router-view></router-view>
|
||||
<router-view
|
||||
:permissions="<?= htmlspecialchars(json_encode($permissions ?? [])); ?>"
|
||||
></router-view>
|
||||
</div>
|
||||
<?php $this->load->view('templates/CISVUE-Footer', $includesArray); ?>
|
||||
|
||||
@@ -12,13 +12,13 @@ $includesArray = array(
|
||||
'tinymce5' => true,
|
||||
'phrases' => array(
|
||||
'global',
|
||||
'ui',
|
||||
'ui'
|
||||
),
|
||||
'customCSSs' => [
|
||||
'public/css/components/vue-datepicker.css',
|
||||
'public/css/components/primevue.css',
|
||||
'public/css/Vertragsverwaltung.css',
|
||||
'public/css/components/Detailheader.css'
|
||||
'public/css/components/Detailheader.css',
|
||||
],
|
||||
'customJSs' => [
|
||||
#'vendor/npm-asset/primevue/tree/tree.min.js',
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
<?php
|
||||
$this->load->view(
|
||||
'templates/FHC-Header',
|
||||
array(
|
||||
$includesArray = array(
|
||||
'title' => 'Lehrauftrag bestellen',
|
||||
'jquery3' => true,
|
||||
'jqueryui1' => true,
|
||||
@@ -12,8 +10,15 @@ $this->load->view(
|
||||
'dialoglib' => true,
|
||||
'navigationwidget' => true,
|
||||
'addons' => true,
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
$this->load->view(
|
||||
'templates/FHC-Header',
|
||||
$includesArray
|
||||
);
|
||||
|
||||
|
||||
?>
|
||||
|
||||
<?php echo $this->widgetlib->widget('NavigationWidget'); ?>
|
||||
@@ -33,4 +38,12 @@ $this->load->view(
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php $this->load->view('templates/FHC-Footer'); ?>
|
||||
<?php
|
||||
|
||||
|
||||
$this->load->view(
|
||||
'templates/FHC-Footer',
|
||||
$includesArray
|
||||
);
|
||||
|
||||
?>
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
<?php
|
||||
$this->load->view(
|
||||
'templates/FHC-Header',
|
||||
array(
|
||||
|
||||
$includesArray = array(
|
||||
'title' => 'Lehrauftrag bestellen',
|
||||
'jquery3' => true,
|
||||
'bootstrap3' => true,
|
||||
@@ -9,8 +8,13 @@ $this->load->view(
|
||||
'sbadmintemplate3' => true,
|
||||
'ajaxlib' => true,
|
||||
'navigationwidget' => true,
|
||||
)
|
||||
);
|
||||
|
||||
$this->load->view(
|
||||
'templates/FHC-Header',
|
||||
$includesArray
|
||||
);
|
||||
|
||||
?>
|
||||
|
||||
<?php echo $this->widgetlib->widget('NavigationWidget'); ?>
|
||||
@@ -34,4 +38,11 @@ $this->load->view(
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php $this->load->view('templates/FHC-Footer'); ?>
|
||||
<?php
|
||||
|
||||
$this->load->view(
|
||||
'templates/FHC-Footer',
|
||||
$includesArray
|
||||
);
|
||||
|
||||
?>
|
||||
|
||||
@@ -1,89 +1,101 @@
|
||||
<?php
|
||||
$this->load->view(
|
||||
'templates/FHC-Header',
|
||||
array(
|
||||
'title' => 'Lehrauftrag annehmen',
|
||||
'jquery3' => true,
|
||||
'jqueryui1' => true,
|
||||
'jquerycheckboxes1' => true,
|
||||
'bootstrap5' => true,
|
||||
'fontawesome6' => true,
|
||||
'sbadmintemplate' => false,
|
||||
'tabulator5' => true,
|
||||
'tabulator5JQuery' => true,
|
||||
'cis'=>true,
|
||||
'momentjs2' => true,
|
||||
'ajaxlib' => true,
|
||||
'dialoglib' => true,
|
||||
'tablewidget' => true,
|
||||
'phrases' => array(
|
||||
'global' => array(
|
||||
'lehrauftraegeAnnehmen',
|
||||
'dokumentePDF',
|
||||
'PDFLehrauftraegeFH',
|
||||
'PDFLehrauftraegeLehrgaenge'
|
||||
),
|
||||
'ui' => array(
|
||||
'anzeigen',
|
||||
'alleAnzeigen',
|
||||
'nurBestellteAnzeigen',
|
||||
'nurErteilteAnzeigen',
|
||||
'nurAngenommeneAnzeigen',
|
||||
'nurStornierteAnzeigen',
|
||||
'hilfeZuDieserSeite',
|
||||
'alleAuswaehlen',
|
||||
'alleAbwaehlen',
|
||||
'ausgewaehlteZeilen',
|
||||
'hilfe',
|
||||
'tabelleneinstellungen',
|
||||
'keineDatenVorhanden',
|
||||
'spaltenEinstellen',
|
||||
'bestelltVon',
|
||||
'erteiltVon',
|
||||
'angenommenVon',
|
||||
'storniertVon',
|
||||
'lehrauftragInBearbeitung',
|
||||
'wartetAufErteilung',
|
||||
'wartetAufErneuteErteilung',
|
||||
'letzterStatusBestellt',
|
||||
'letzterStatusErteilt',
|
||||
'letzterStatusAngenommen',
|
||||
'vertragWurdeStorniert',
|
||||
),
|
||||
'password' => array('password'),
|
||||
'dms' => array('informationsblattExterneLehrende'),
|
||||
'table' => array(
|
||||
'spaltenEinAusblenden',
|
||||
'spaltenEinAusblendenMitKlickOeffnen',
|
||||
'spaltenEinAusblendenAufEinstellungenKlicken',
|
||||
'spaltenEinAusblendenMitKlickAktivieren',
|
||||
'spaltenEinAusblendenMitKlickSchliessen',
|
||||
'spaltenbreiteVeraendern',
|
||||
'spaltenbreiteVeraendernText',
|
||||
'spaltenbreiteVeraendernInfotext',
|
||||
'zeilenAuswaehlen',
|
||||
'zeilenAuswaehlenEinzeln',
|
||||
'zeilenAuswaehlenBereich',
|
||||
'zeilenAuswaehlenAlle'
|
||||
),
|
||||
'lehre' => array(
|
||||
'lehrauftraegeAnnehmen',
|
||||
'lehrauftraegeAnnehmenText',
|
||||
'lehrauftraegeAnnehmenKlickStatusicon',
|
||||
'lehrauftraegeAnnehmenLehrauftraegeWaehlen',
|
||||
'lehrauftraegeAnnehmenMitKlickAnnehmen',
|
||||
'lehrauftraegeNichtAuswaehlbar',
|
||||
'lehrauftraegeNichtAuswaehlbarTextBeiAnnahme',
|
||||
'filterAlleBeiAnnahme',
|
||||
'filterErteiltBeiAnnahme',
|
||||
'filterAngenommen'
|
||||
)
|
||||
|
||||
$includesArray = array(
|
||||
'title' => 'Lehrauftrag annehmen',
|
||||
'jquery3' => true,
|
||||
'jqueryui1' => true,
|
||||
'jquerycheckboxes1' => true,
|
||||
'bootstrap5' => true,
|
||||
'fontawesome6' => true,
|
||||
'sbadmintemplate' => false,
|
||||
'tabulator5' => true,
|
||||
'tabulator5JQuery' => true,
|
||||
'cis'=>true,
|
||||
'momentjs2' => true,
|
||||
'ajaxlib' => true,
|
||||
'dialoglib' => true,
|
||||
'tablewidget' => true,
|
||||
'phrases' => array(
|
||||
'global' => array(
|
||||
'lehrauftraegeAnnehmen',
|
||||
'dokumentePDF',
|
||||
'PDFLehrauftraegeFH',
|
||||
'PDFLehrauftraegeLehrgaenge'
|
||||
),
|
||||
'customJSs' => array(
|
||||
'public/js/bootstrapper.js',
|
||||
'public/js/lehre/lehrauftrag/acceptLehrauftrag.js')
|
||||
'ui' => array(
|
||||
'anzeigen',
|
||||
'alleAnzeigen',
|
||||
'nurBestellteAnzeigen',
|
||||
'nurErteilteAnzeigen',
|
||||
'nurAngenommeneAnzeigen',
|
||||
'nurStornierteAnzeigen',
|
||||
'hilfeZuDieserSeite',
|
||||
'alleAuswaehlen',
|
||||
'alleAbwaehlen',
|
||||
'ausgewaehlteZeilen',
|
||||
'hilfe',
|
||||
'tabelleneinstellungen',
|
||||
'keineDatenVorhanden',
|
||||
'spaltenEinstellen',
|
||||
'bestelltVon',
|
||||
'erteiltVon',
|
||||
'angenommenVon',
|
||||
'storniertVon',
|
||||
'lehrauftragInBearbeitung',
|
||||
'wartetAufErteilung',
|
||||
'wartetAufErneuteErteilung',
|
||||
'letzterStatusBestellt',
|
||||
'letzterStatusErteilt',
|
||||
'letzterStatusAngenommen',
|
||||
'vertragWurdeStorniert',
|
||||
),
|
||||
'password' => array('password'),
|
||||
'dms' => array('informationsblattExterneLehrende'),
|
||||
'table' => array(
|
||||
'spaltenEinAusblenden',
|
||||
'spaltenEinAusblendenMitKlickOeffnen',
|
||||
'spaltenEinAusblendenAufEinstellungenKlicken',
|
||||
'spaltenEinAusblendenMitKlickAktivieren',
|
||||
'spaltenEinAusblendenMitKlickSchliessen',
|
||||
'spaltenbreiteVeraendern',
|
||||
'spaltenbreiteVeraendernText',
|
||||
'spaltenbreiteVeraendernInfotext',
|
||||
'zeilenAuswaehlen',
|
||||
'zeilenAuswaehlenEinzeln',
|
||||
'zeilenAuswaehlenBereich',
|
||||
'zeilenAuswaehlenAlle'
|
||||
),
|
||||
'lehre' => array(
|
||||
'lehrauftraegeAnnehmen',
|
||||
'lehrauftraegeAnnehmenText',
|
||||
'lehrauftraegeAnnehmenKlickStatusicon',
|
||||
'lehrauftraegeAnnehmenLehrauftraegeWaehlen',
|
||||
'lehrauftraegeAnnehmenMitKlickAnnehmen',
|
||||
'lehrauftraegeNichtAuswaehlbar',
|
||||
'lehrauftraegeNichtAuswaehlbarTextBeiAnnahme',
|
||||
'filterAlleBeiAnnahme',
|
||||
'filterErteiltBeiAnnahme',
|
||||
'filterAngenommen'
|
||||
)
|
||||
),
|
||||
'customJSs' => array(
|
||||
'public/js/bootstrapper.js',
|
||||
'public/js/lehre/lehrauftrag/acceptLehrauftrag.js'
|
||||
)
|
||||
);
|
||||
|
||||
if (defined("CIS4")) {
|
||||
$this->load->view(
|
||||
'templates/CISVUE-Header',
|
||||
$includesArray
|
||||
);
|
||||
} else {
|
||||
$this->load->view(
|
||||
'templates/FHC-Header',
|
||||
$includesArray
|
||||
);
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
|
||||
@@ -230,5 +242,17 @@ $this->load->view(
|
||||
</div><!-- end page-wrapper -->
|
||||
<br>
|
||||
|
||||
<?php $this->load->view('templates/FHC-Footer'); ?>
|
||||
<?php
|
||||
if (defined("CIS4")) {
|
||||
$this->load->view(
|
||||
'templates/CISVUE-Footer',
|
||||
$includesArray
|
||||
);
|
||||
} else {
|
||||
$this->load->view(
|
||||
'templates/FHC-Footer',
|
||||
$includesArray
|
||||
);
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
@@ -1,98 +1,101 @@
|
||||
<?php
|
||||
$includesArray = array(
|
||||
'title' => 'Lehrauftrag erteilen',
|
||||
'jquery3' => true,
|
||||
'jqueryui1' => true,
|
||||
'jquerycheckboxes1' => true,
|
||||
'bootstrap3' => true,
|
||||
'fontawesome6' => true,
|
||||
'sbadmintemplate3' => true,
|
||||
'tabulator5' => true,
|
||||
'tabulator5JQuery' => true,
|
||||
'momentjs2' => true,
|
||||
'ajaxlib' => true,
|
||||
'dialoglib' => true,
|
||||
'tablewidget' => true,
|
||||
'navigationwidget' => true,
|
||||
'phrases' => array(
|
||||
'global' => array(
|
||||
'lehrauftraegeErteilen',
|
||||
'mehrHilfe',
|
||||
'weitereInformationenUnter'
|
||||
),
|
||||
'ui' => array(
|
||||
'anzeigen',
|
||||
'alleAnzeigen',
|
||||
'nurNeueAnzeigen',
|
||||
'nurBestellteAnzeigen',
|
||||
'nurErteilteAnzeigen',
|
||||
'nurAngenommeneAnzeigen',
|
||||
'nurGeaenderteAnzeigen',
|
||||
'nurDummiesAnzeigen',
|
||||
'hilfeZuDieserSeite',
|
||||
'alleAuswaehlen',
|
||||
'alleAbwaehlen',
|
||||
'ausgewaehlteZeilen',
|
||||
'hilfe',
|
||||
'tabelleneinstellungen',
|
||||
'keineDatenVorhanden',
|
||||
'spaltenEinstellen',
|
||||
'bestelltVon',
|
||||
'erteiltVon',
|
||||
'angenommenVon',
|
||||
'stundenStundensatzGeaendert',
|
||||
'neuerLehrauftragOhneLektorVerplant',
|
||||
'wartetAufBestellung',
|
||||
'wartetAufErneuteBestellung',
|
||||
'neuerLehrauftragWartetAufBestellung',
|
||||
'letzterStatusBestellt',
|
||||
'letzterStatusErteilt',
|
||||
'letzterStatusAngenommen',
|
||||
),
|
||||
'table' => array(
|
||||
'spaltenEinAusblenden',
|
||||
'spaltenEinAusblendenMitKlickOeffnen',
|
||||
'spaltenEinAusblendenAufEinstellungenKlicken',
|
||||
'spaltenEinAusblendenMitKlickAktivieren',
|
||||
'spaltenEinAusblendenMitKlickSchliessen',
|
||||
'spaltenbreiteVeraendern',
|
||||
'spaltenbreiteVeraendernText',
|
||||
'spaltenbreiteVeraendernInfotext',
|
||||
'zeilenAuswaehlen',
|
||||
'zeilenAuswaehlenEinzeln',
|
||||
'zeilenAuswaehlenBereich',
|
||||
'zeilenAuswaehlenAlle'
|
||||
),
|
||||
'lehre' => array(
|
||||
'lehrauftragStandardBestellprozess',
|
||||
'lehrauftragStandardBestellprozessBestellen',
|
||||
'lehrauftragStandardBestellprozessErteilen',
|
||||
'lehrauftragStandardBestellprozessAnnehmen',
|
||||
'lehrauftraegeErteilen',
|
||||
'lehrauftraegeErteilenText',
|
||||
'lehrauftraegeErteilenKlickStatusicon',
|
||||
'lehrauftraegeErteilenLehrauftraegeWaehlen',
|
||||
'lehrauftraegeErteilenMitKlickErteilen',
|
||||
'geaenderteLehrauftraege',
|
||||
'geaenderteLehrauftraegeTextBeiErteilung',
|
||||
'lehrauftraegeNichtAuswaehlbar',
|
||||
'lehrauftraegeNichtAuswaehlbarTextBeiErteilung',
|
||||
'filterAlle',
|
||||
'filterNeu',
|
||||
'filterBestellt',
|
||||
'filterErteilt',
|
||||
'filterAngenommen',
|
||||
'filterGeaendert',
|
||||
'filterDummies'
|
||||
)
|
||||
),
|
||||
'customJSs' => array(
|
||||
'public/js/bootstrapper.js',
|
||||
'public/js/lehre/lehrauftrag/approveLehrauftrag.js'
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
$this->load->view(
|
||||
'templates/FHC-Header',
|
||||
array(
|
||||
'title' => 'Lehrauftrag erteilen',
|
||||
'jquery3' => true,
|
||||
'jqueryui1' => true,
|
||||
'jquerycheckboxes1' => true,
|
||||
'bootstrap3' => true,
|
||||
'fontawesome6' => true,
|
||||
'sbadmintemplate3' => true,
|
||||
'tabulator5' => true,
|
||||
'tabulator5JQuery' => true,
|
||||
'momentjs2' => true,
|
||||
'ajaxlib' => true,
|
||||
'dialoglib' => true,
|
||||
'tablewidget' => true,
|
||||
'navigationwidget' => true,
|
||||
'phrases' => array(
|
||||
'global' => array(
|
||||
'lehrauftraegeErteilen',
|
||||
'mehrHilfe',
|
||||
'weitereInformationenUnter'
|
||||
),
|
||||
'ui' => array(
|
||||
'anzeigen',
|
||||
'alleAnzeigen',
|
||||
'nurNeueAnzeigen',
|
||||
'nurBestellteAnzeigen',
|
||||
'nurErteilteAnzeigen',
|
||||
'nurAngenommeneAnzeigen',
|
||||
'nurGeaenderteAnzeigen',
|
||||
'nurDummiesAnzeigen',
|
||||
'hilfeZuDieserSeite',
|
||||
'alleAuswaehlen',
|
||||
'alleAbwaehlen',
|
||||
'ausgewaehlteZeilen',
|
||||
'hilfe',
|
||||
'tabelleneinstellungen',
|
||||
'keineDatenVorhanden',
|
||||
'spaltenEinstellen',
|
||||
'bestelltVon',
|
||||
'erteiltVon',
|
||||
'angenommenVon',
|
||||
'stundenStundensatzGeaendert',
|
||||
'neuerLehrauftragOhneLektorVerplant',
|
||||
'wartetAufBestellung',
|
||||
'wartetAufErneuteBestellung',
|
||||
'neuerLehrauftragWartetAufBestellung',
|
||||
'letzterStatusBestellt',
|
||||
'letzterStatusErteilt',
|
||||
'letzterStatusAngenommen',
|
||||
),
|
||||
'table' => array(
|
||||
'spaltenEinAusblenden',
|
||||
'spaltenEinAusblendenMitKlickOeffnen',
|
||||
'spaltenEinAusblendenAufEinstellungenKlicken',
|
||||
'spaltenEinAusblendenMitKlickAktivieren',
|
||||
'spaltenEinAusblendenMitKlickSchliessen',
|
||||
'spaltenbreiteVeraendern',
|
||||
'spaltenbreiteVeraendernText',
|
||||
'spaltenbreiteVeraendernInfotext',
|
||||
'zeilenAuswaehlen',
|
||||
'zeilenAuswaehlenEinzeln',
|
||||
'zeilenAuswaehlenBereich',
|
||||
'zeilenAuswaehlenAlle'
|
||||
),
|
||||
'lehre' => array(
|
||||
'lehrauftragStandardBestellprozess',
|
||||
'lehrauftragStandardBestellprozessBestellen',
|
||||
'lehrauftragStandardBestellprozessErteilen',
|
||||
'lehrauftragStandardBestellprozessAnnehmen',
|
||||
'lehrauftraegeErteilen',
|
||||
'lehrauftraegeErteilenText',
|
||||
'lehrauftraegeErteilenKlickStatusicon',
|
||||
'lehrauftraegeErteilenLehrauftraegeWaehlen',
|
||||
'lehrauftraegeErteilenMitKlickErteilen',
|
||||
'geaenderteLehrauftraege',
|
||||
'geaenderteLehrauftraegeTextBeiErteilung',
|
||||
'lehrauftraegeNichtAuswaehlbar',
|
||||
'lehrauftraegeNichtAuswaehlbarTextBeiErteilung',
|
||||
'filterAlle',
|
||||
'filterNeu',
|
||||
'filterBestellt',
|
||||
'filterErteilt',
|
||||
'filterAngenommen',
|
||||
'filterGeaendert',
|
||||
'filterDummies'
|
||||
)
|
||||
),
|
||||
'customJSs' => array(
|
||||
'public/js/bootstrapper.js',
|
||||
'public/js/lehre/lehrauftrag/approveLehrauftrag.js'
|
||||
)
|
||||
)
|
||||
'templates/FHC-Header',
|
||||
$includesArray
|
||||
);
|
||||
?>
|
||||
|
||||
@@ -208,5 +211,13 @@ $this->load->view(
|
||||
</div><!-- end page-wrapper -->
|
||||
<br>
|
||||
|
||||
<?php $this->load->view('templates/FHC-Footer'); ?>
|
||||
<?php
|
||||
|
||||
|
||||
$this->load->view(
|
||||
'templates/FHC-Footer',
|
||||
$includesArray
|
||||
);
|
||||
|
||||
?>
|
||||
|
||||
|
||||
@@ -1,98 +1,101 @@
|
||||
<?php
|
||||
$includesArray = array(
|
||||
'title' => 'Lehrauftrag bestellen',
|
||||
'jquery3' => true,
|
||||
'jqueryui1' => true,
|
||||
'jquerycheckboxes1' => true,
|
||||
'bootstrap3' => true,
|
||||
'fontawesome6' => true,
|
||||
'sbadmintemplate3' => true,
|
||||
'tabulator5' => true,
|
||||
'tabulator5JQuery' => true,
|
||||
'momentjs2' => true,
|
||||
'ajaxlib' => true,
|
||||
'dialoglib' => true,
|
||||
'tablewidget' => true,
|
||||
'navigationwidget' => true,
|
||||
'phrases' => array(
|
||||
'global' => array(
|
||||
'lehrauftraegeBestellen',
|
||||
'mehrHilfe',
|
||||
'weitereInformationenUnter'
|
||||
),
|
||||
'ui' => array(
|
||||
'anzeigen',
|
||||
'alleAnzeigen',
|
||||
'nurNeueAnzeigen',
|
||||
'nurBestellteAnzeigen',
|
||||
'nurErteilteAnzeigen',
|
||||
'nurAngenommeneAnzeigen',
|
||||
'nurGeaenderteAnzeigen',
|
||||
'nurDummiesAnzeigen',
|
||||
'hilfeZuDieserSeite',
|
||||
'alleAuswaehlen',
|
||||
'alleAbwaehlen',
|
||||
'ausgewaehlteZeilen',
|
||||
'hilfe',
|
||||
'tabelleneinstellungen',
|
||||
'keineDatenVorhanden',
|
||||
'spaltenEinstellen',
|
||||
'bestelltVon',
|
||||
'erteiltVon',
|
||||
'angenommenVon',
|
||||
'neuerLehrauftragOhneLektorVerplant',
|
||||
'neuerLehrauftragWartetAufBestellung',
|
||||
'letzterStatusBestellt',
|
||||
'letzterStatusErteilt',
|
||||
'letzterStatusAngenommen',
|
||||
'nachAenderungStundensatzStunden',
|
||||
'vorAenderungStundensatzStunden'
|
||||
),
|
||||
'table' => array(
|
||||
'spaltenEinAusblenden',
|
||||
'spaltenEinAusblendenMitKlickOeffnen',
|
||||
'spaltenEinAusblendenAufEinstellungenKlicken',
|
||||
'spaltenEinAusblendenMitKlickAktivieren',
|
||||
'spaltenEinAusblendenMitKlickSchliessen',
|
||||
'spaltenbreiteVeraendern',
|
||||
'spaltenbreiteVeraendernText',
|
||||
'spaltenbreiteVeraendernInfotext',
|
||||
'zeilenAuswaehlen',
|
||||
'zeilenAuswaehlenEinzeln',
|
||||
'zeilenAuswaehlenBereich',
|
||||
'zeilenAuswaehlenAlle'
|
||||
),
|
||||
'lehre' => array(
|
||||
'lehrauftragStandardBestellprozess',
|
||||
'lehrauftragStandardBestellprozessBestellen',
|
||||
'lehrauftragStandardBestellprozessErteilen',
|
||||
'lehrauftragStandardBestellprozessAnnehmen',
|
||||
'lehrauftraegeBestellen',
|
||||
'lehrauftraegeBestellenText',
|
||||
'lehrauftraegeBestellenKlickStatusicon',
|
||||
'lehrauftraegeBestellenLehrauftraegeWaehlen',
|
||||
'lehrauftraegeBestellenMitKlickBestellen',
|
||||
'lehrauftraegeBestellenVertragWirdAngelegt',
|
||||
'geaenderteLehrauftraege',
|
||||
'geaenderteLehrauftraegeText',
|
||||
'lehrauftraegeNichtAuswaehlbar',
|
||||
'lehrauftraegeNichtAuswaehlbarText',
|
||||
'filterAlle',
|
||||
'filterNeu',
|
||||
'filterBestellt',
|
||||
'filterErteilt',
|
||||
'filterAngenommen',
|
||||
'filterGeaendert',
|
||||
'filterDummies'
|
||||
)
|
||||
),
|
||||
'customJSs' => array(
|
||||
'public/js/bootstrapper.js',
|
||||
'public/js/lehre/lehrauftrag/orderLehrauftrag.js'
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
$this->load->view(
|
||||
'templates/FHC-Header',
|
||||
array(
|
||||
'title' => 'Lehrauftrag bestellen',
|
||||
'jquery3' => true,
|
||||
'jqueryui1' => true,
|
||||
'jquerycheckboxes1' => true,
|
||||
'bootstrap3' => true,
|
||||
'fontawesome6' => true,
|
||||
'sbadmintemplate3' => true,
|
||||
'tabulator5' => true,
|
||||
'tabulator5JQuery' => true,
|
||||
'momentjs2' => true,
|
||||
'ajaxlib' => true,
|
||||
'dialoglib' => true,
|
||||
'tablewidget' => true,
|
||||
'navigationwidget' => true,
|
||||
'phrases' => array(
|
||||
'global' => array(
|
||||
'lehrauftraegeBestellen',
|
||||
'mehrHilfe',
|
||||
'weitereInformationenUnter'
|
||||
),
|
||||
'ui' => array(
|
||||
'anzeigen',
|
||||
'alleAnzeigen',
|
||||
'nurNeueAnzeigen',
|
||||
'nurBestellteAnzeigen',
|
||||
'nurErteilteAnzeigen',
|
||||
'nurAngenommeneAnzeigen',
|
||||
'nurGeaenderteAnzeigen',
|
||||
'nurDummiesAnzeigen',
|
||||
'hilfeZuDieserSeite',
|
||||
'alleAuswaehlen',
|
||||
'alleAbwaehlen',
|
||||
'ausgewaehlteZeilen',
|
||||
'hilfe',
|
||||
'tabelleneinstellungen',
|
||||
'keineDatenVorhanden',
|
||||
'spaltenEinstellen',
|
||||
'bestelltVon',
|
||||
'erteiltVon',
|
||||
'angenommenVon',
|
||||
'neuerLehrauftragOhneLektorVerplant',
|
||||
'neuerLehrauftragWartetAufBestellung',
|
||||
'letzterStatusBestellt',
|
||||
'letzterStatusErteilt',
|
||||
'letzterStatusAngenommen',
|
||||
'nachAenderungStundensatzStunden',
|
||||
'vorAenderungStundensatzStunden'
|
||||
),
|
||||
'table' => array(
|
||||
'spaltenEinAusblenden',
|
||||
'spaltenEinAusblendenMitKlickOeffnen',
|
||||
'spaltenEinAusblendenAufEinstellungenKlicken',
|
||||
'spaltenEinAusblendenMitKlickAktivieren',
|
||||
'spaltenEinAusblendenMitKlickSchliessen',
|
||||
'spaltenbreiteVeraendern',
|
||||
'spaltenbreiteVeraendernText',
|
||||
'spaltenbreiteVeraendernInfotext',
|
||||
'zeilenAuswaehlen',
|
||||
'zeilenAuswaehlenEinzeln',
|
||||
'zeilenAuswaehlenBereich',
|
||||
'zeilenAuswaehlenAlle'
|
||||
),
|
||||
'lehre' => array(
|
||||
'lehrauftragStandardBestellprozess',
|
||||
'lehrauftragStandardBestellprozessBestellen',
|
||||
'lehrauftragStandardBestellprozessErteilen',
|
||||
'lehrauftragStandardBestellprozessAnnehmen',
|
||||
'lehrauftraegeBestellen',
|
||||
'lehrauftraegeBestellenText',
|
||||
'lehrauftraegeBestellenKlickStatusicon',
|
||||
'lehrauftraegeBestellenLehrauftraegeWaehlen',
|
||||
'lehrauftraegeBestellenMitKlickBestellen',
|
||||
'lehrauftraegeBestellenVertragWirdAngelegt',
|
||||
'geaenderteLehrauftraege',
|
||||
'geaenderteLehrauftraegeText',
|
||||
'lehrauftraegeNichtAuswaehlbar',
|
||||
'lehrauftraegeNichtAuswaehlbarText',
|
||||
'filterAlle',
|
||||
'filterNeu',
|
||||
'filterBestellt',
|
||||
'filterErteilt',
|
||||
'filterAngenommen',
|
||||
'filterGeaendert',
|
||||
'filterDummies'
|
||||
)
|
||||
),
|
||||
'customJSs' => array(
|
||||
'public/js/bootstrapper.js',
|
||||
'public/js/lehre/lehrauftrag/orderLehrauftrag.js'
|
||||
)
|
||||
)
|
||||
'templates/FHC-Header',
|
||||
$includesArray
|
||||
);
|
||||
?>
|
||||
|
||||
@@ -209,5 +212,11 @@ $this->load->view(
|
||||
</div><!-- end page-wrapper -->
|
||||
<br>
|
||||
|
||||
<?php $this->load->view('templates/FHC-Footer'); ?>
|
||||
<?php
|
||||
|
||||
$this->load->view(
|
||||
'templates/FHC-Footer',
|
||||
$includesArray
|
||||
);
|
||||
?>
|
||||
|
||||
|
||||
@@ -9,22 +9,8 @@ $sitesettings = array(
|
||||
'ajaxlib' => true,
|
||||
'sbadmintemplate3' => true,
|
||||
'phrases' => array(
|
||||
'abschlusspruefung' => array(
|
||||
'freigegebenAm',
|
||||
'pruefungGespeichert',
|
||||
'pruefungSpeichernFehler',
|
||||
'abschlussbeurteilungLeer',
|
||||
'beginnzeitLeer',
|
||||
'beginnzeitFormatError',
|
||||
'endezeitLeer',
|
||||
'endezeitFormatError',
|
||||
'endezeitBeforeError',
|
||||
'verfNotice'
|
||||
),
|
||||
'ui' => array(
|
||||
'stunde',
|
||||
'minute'
|
||||
)
|
||||
'abschlusspruefung',
|
||||
'ui'
|
||||
),
|
||||
'customCSSs' => array(
|
||||
'public/css/sbadmin2/admintemplate_contentonly.css',
|
||||
@@ -37,10 +23,18 @@ $sitesettings = array(
|
||||
)
|
||||
);
|
||||
|
||||
$this->load->view(
|
||||
'templates/FHC-Header',
|
||||
$sitesettings
|
||||
);
|
||||
if(defined('CIS4')){
|
||||
$this->load->view(
|
||||
'templates/CISVUE-Header',
|
||||
$sitesettings
|
||||
);
|
||||
}else{
|
||||
$this->load->view(
|
||||
'templates/FHC-Header',
|
||||
$sitesettings
|
||||
);
|
||||
}
|
||||
|
||||
?>
|
||||
<div id="wrapper">
|
||||
<div id="page-wrapper">
|
||||
@@ -161,6 +155,14 @@ $this->load->view(
|
||||
<?php echo ($abschlusspruefung->studiengangstyp == 'Bachelor' ? $this->p->t('abschlusspruefung', 'pruefungsgegenstandBachelor') : $this->p->t('abschlusspruefung', 'pruefungsgegenstandMaster')) ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<?php echo $this->p->t('abschlusspruefung', 'spracheDerArbeit') ?> <?php echo $arbeit_name ?>
|
||||
</td>
|
||||
<td colspan="5">
|
||||
<?php echo $abschlusspruefung->abschlussarbeit_sprache ?? '' ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="6">
|
||||
<?php echo ucfirst($this->p->t('global', 'notizen')); ?>
|
||||
@@ -201,7 +203,9 @@ $this->load->view(
|
||||
<div class="col-lg-12 text-right">
|
||||
<p>
|
||||
<?php $freigegeben = isset($abschlusspruefung->freigabedatum); ?>
|
||||
<button id="saveProtocolBtn" class="btn btn-default"<?php echo $freigegeben ? " disabled" : "" ?>><?php echo $this->p->t('ui', 'speichern') ?></button>
|
||||
<button id="saveProtocolBtn" class="btn btn-default"<?php echo $freigegeben ? ' disabled title="'.$this->p->t('abschlusspruefung', 'bereitsFreigegeben').'"' : '' ?>>
|
||||
<?php echo $this->p->t('ui', 'speichern') ?>
|
||||
</button>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
@@ -236,7 +240,14 @@ $this->load->view(
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
$this->load->view(
|
||||
'templates/FHC-Footer',
|
||||
$sitesettings
|
||||
);
|
||||
if (defined('CIS4')) {
|
||||
$this->load->view(
|
||||
'templates/CISVUE-Footer',
|
||||
$sitesettings
|
||||
);
|
||||
} else {
|
||||
$this->load->view(
|
||||
'templates/FHC-Footer',
|
||||
$sitesettings
|
||||
);
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user