aboutsummaryrefslogtreecommitdiff
path: root/app/views/shared/modul/overview.php
blob: 7e07ee851b55d4706a108acf056a9f44326cc39b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
<?php
/**
 * @var Modul $modul
 * @var Semester $semester
 * @var string $pruef_ebene
 * @var int $type
 * @var string $code
 * @var string $title
 */
?>

<? $deskriptor = $modul->getDeskriptor() ?>
<table class="default mvv-modul-details nohover">
    <tr>
        <th class="mvv-modul-details-head" style="width: 30%">
            <?= htmlReady($code ?: $modul->code) ?>
        </th>
        <th class="mvv-modul-details-head" style="width: 30%">
            <?= $modul->responsible_institute ? htmlReady($modul->responsible_institute->institute->name) : '' ?>
        </th>
        <th class="mvv-modul-details-head" style="width: 40%"></th>
        <th class="mvv-modul-details-head" style="white-space: nowrap;">
            <?= sprintf("%d CP", $modul->getReplacedValue('kp')) ?>
        </th>
    </tr>
    <tr>
        <td colspan="2">
            <h3><?= htmlReady($title ?: $deskriptor->bezeichnung) ?></h3>
            <?= _('Lehrveranstaltungen') ?> <?= htmlReady($semester->name) ?>
        </td>
        <td>
            <dl>
            <? foreach ($GLOBALS['MVV_MODUL']['PERSONEN_GRUPPEN']['values'] as $key => $gruppe) : ?>
                <? $contacts = $modul->contact_assignments->findBy('category', $key)->orderBy('position', SORT_NUMERIC); ?>
                <? if ($gruppe['visible'] && count($contacts)) : ?>
                <dt><?= htmlReady($gruppe['name']) ?></dt>
                <? foreach ($contacts as $modul_contact): ?>
                <dd><?= htmlReady($modul_contact->contact->getDisplayName()) ?></dd>
                <? endforeach; ?>
                <? endif; ?>
            <? endforeach; ?>
            </dl>
        </td>
        <td>
            <? if ($GLOBALS['perm']->have_perm('admin')) : ?>
                <a href="<?= URLHelper::getLink("dispatch.php/shared/modul/mail/{$modul->id}/{$semester->id}")?>" data-dialog>
                    <?= Icon::create('mail', Icon::ROLE_CLICKABLE, tooltip2(_('Nachricht an alle Teilnehmenden der Veranstaltungen, die diesem Modul zugeordnet sind.')))?>
                </a>
            <? endif; ?>
        </td>
    </tr>
    <tr>
        <td colspan="4" style="padding: 0;">
            <table class="default nohover">
                <? if (mb_strlen($deskriptor->getReplacedValue('voraussetzung')) > 0): ?>
                    <tr>
                        <td style="width: 20%; font-weight: bold;"><?= _('Teilnahmevoraussetzungen') ?></td>
                        <td ><?= formatReady($deskriptor->getReplacedValue('voraussetzung')) ?></td>
                    </tr>
                <? endif; ?>
                <? if (mb_strlen($deskriptor->getReplacedValue('kommentar'))) : ?>
                    <tr>
                        <td style="width: 20%; font-weight: bold;"><?= _('Hinweise') ?></td>
                        <td><?= formatReady($deskriptor->getReplacedValue('kommentar')) ?></td>
                    </tr>
                <? endif; ?>
                <? if (mb_strlen($deskriptor->ersatztext) > 0): ?>
                    <tr>
                        <td style="width: 20%; font-weight: bold;"> </td>
                        <td><?= formatReady($deskriptor->getReplacedValue('ersatztext')) ?></td>
                    </tr>
                <? else: ?>

                    <? if ($modul->kapazitaet > 0): ?>
                        <tr>
                            <td style="width: 20%; font-weight: bold;"><?= _('Kapazität Modul') ?></td>
                            <td>
                                <?= htmlReady($modul->kapazitaet) ?>
                                <? if (mb_strlen($deskriptor->getReplacedValue('kommentar_kapazitaet')) > 0): ?>
                                    (<?= formatReady($deskriptor->getReplacedValue('kommentar_kapazitaet')) ?>)
                                <? endif; ?>

                            </td>
                        </tr>
                    <? endif; ?>
                    <? if (mb_strlen($pruef_ebene) > 0): ?>
                        <tr>
                            <td style="width: 20%; font-weight: bold;"><?= _('Prüfungsebene') ?></td>
                            <td><?= htmlReady($pruef_ebene) ?></td>
                        </tr>
                    <? endif; ?>
                    <? if (mb_strlen($deskriptor->getReplacedValue('pruef_vorleistung'))) : ?>
                        <tr>
                            <td style="width: 20%; font-weight: bold;"><?= _('Prüfungsvorleistung Modul') ?></td>
                            <td><?= formatReady($deskriptor->getReplacedValue('pruef_vorleistung')) ?></td>
                        </tr>
                    <? endif; ?>
                    <? if (mb_strlen($deskriptor->pruef_leistung)) : ?>
                        <tr>
                            <td style="width: 20%; font-weight: bold;"><?= _('Prüfungsleistung Modul') ?></td>
                            <td><?= formatReady($deskriptor->getReplacedValue('pruef_leistung')) ?></td>
                        </tr>
                    <? endif; ?>
                    <? if (mb_strlen($deskriptor->kompetenzziele)): ?>
                        <tr>
                            <td style="width: 20%; font-weight: bold;"><?= _('Kompetenzziele') ?></td>
                            <td><?= formatReady($deskriptor->getReplacedValue('kompetenzziele')) ?></td>
                        </tr>
                    <? endif; ?>

                <? endif; ?>
            </table>
        </td>
    </tr>
    <? if ($type !== 3): ?>
        <tr>
            <? if ($type === 1): ?>
                <th><?= _('Modulteile') ?></th>
            <? endif; ?>
            <th <? if ($type === 2): ?> colspan="4" <? endif; ?> ><?= _('Semesterveranstaltungen') ?></th>
            <? if ($type === 1): ?>
                <th colspan="2"><?= _('Prüfungsleistung') ?></th>
            <? endif; ?>
        </tr>
        <? foreach ($modul->modulteile as $modulteil): ?>
            <? $modulteil_deskriptor = $modulteil->getDeskriptor() ?>
            <tr>
                <? if ($type === 1): ?>
                <td>
                    <b> <?= htmlReady($modulteil->getDisplayName()) ?> </b>
                    <? if (mb_strlen($modulteil_deskriptor->getReplacedValue('kommentar')) > 0): ?>
                    <?= trim($modulteil_deskriptor->getReplacedValue('kommentar')) ? '<br>(' . formatReady($modulteil_deskriptor->getReplacedValue('kommentar')) . ')' : '' ?>
                    <? endif; ?>
                    <? if (mb_strlen($modulteil_deskriptor->getReplacedValue('voraussetzung')) > 0): ?>
                        <br>
                        <b><?= _('Teilnahmevoraussetzungen') ?>:</b> <?= formatReady($modulteil_deskriptor->getReplacedValue('voraussetzung')) ?>
                    <? endif; ?>
                </td>
                <? endif; ?>
                <td  <? if ($type === 2): ?> colspan="3" <? endif; ?>>
                    <? foreach ($modulteil->lvgruppen as $gruppe): ?>
                        <? if (mb_strlen($gruppe->alttext) > 0): ?>
                            <?= formatReady($gruppe->alttext) ?>
                        <? endif; ?>
                        <? $courses = $gruppe->courses->filter(
                            fn(\Course $course) => $course->isInSemester($semester)
                        ) ?>
                        <? if (count($courses)) : ?>
                        <ul>
                        <? foreach ($courses as $course): ?>
                            <li>
                                <a href="<?= URLHelper::getLink('dispatch.php/course/details', ['sem_id' => $course->id]) ?>">
                                <?= htmlReady(($course->veranstaltungsnummer ? $course->veranstaltungsnummer . ' - ' : '') . $course->name) ?>
                                </a>
                                <? if (!$course->visible) : ?>
                                <em><?= _('[versteckt]') ?></em>
                                <? endif; ?>
                                <? if (Config::get()->COURSE_SEARCH_SHOW_ADMISSION_STATE) : ?>
                                    <?
                                    $admission_status = GlobalSearchCourses::getStatusCourseAdmission($course->id, $course->admission_prelim);
                                    ?>
                                    <? echo match ($admission_status) {
                                        1 => Icon::create('span-2quarter', Icon::ROLE_STATUS_YELLOW, [
                                            'alt' => _('Eingeschränkter Zugang'),
                                            'title' => _('Eingeschränkter Zugang'),
                                            'style' => 'vertical-align: text-bottom',
                                        ]),
                                        2 => Icon::create('span-empty', Icon::ROLE_STATUS_RED, [
                                            'alt' => _('Kein Zugang'),
                                            'title' => _('Kein Zugang'),
                                            'style' => 'vertical-align: text-bottom',
                                        ]),
                                        default => Icon::create('span-full', Icon::ROLE_STATUS_GREEN, [
                                            'alt' => _('Uneingeschränkter Zugang'),
                                            'title' => _('Uneingeschränkter Zugang'),
                                            'style' => 'vertical-align: text-bottom',
                                        ]),
                                    }; ?>
                                <? endif; ?>
                            </li>
                        <? endforeach; ?>
                        </ul>
                        <? endif; ?>
                    <? endforeach; ?>
                </td>
                <? if ($type === 1) : ?>
                    <td colspan="2">
                        <? if (mb_strlen($modulteil_deskriptor->getReplacedValue('pruef_vorleistung')) > 0) : ?>
                            <b><?= _('Prüfungsvorleistung') ?>:</b> <?= htmlReady($modulteil_deskriptor->getReplacedValue('pruef_vorleistung')) ?>

                        <? endif; ?>
                        <? if (mb_strlen($modulteil_deskriptor->pruef_leistung) > 0) : ?>
                            <b><?= _('Prüfungsform') ?>:</b> <br/><?= htmlReady($modulteil_deskriptor->getReplacedValue('pruef_leistung')) ?> (<?= ($modulteil->anteil_note ? '(' . htmlReady($modulteil->anteil_note) . '%)' : '') ?>
                        <? endif; ?>
                    </td>
                <? endif; ?>
            </tr>
        <? endforeach; ?>
    <? endif; ?>
</table>