blob: e913cf49c0140d22384b908ac9646a436080cdb8 (
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
|
<? use Studip\Button; ?>
<h2><?= _('Ich studiere folgende Fächer und Abschlüsse:') ?></h2>
<form action="<?= $controller->store_sg() ?>" method="post" class="default">
<?= CSRFProtection::tokenTag() ?>
<table class="default" id="select_fach_abschluss">
<colgroup>
<col>
<col>
<col>
<col style="width: 100px">
<? if ($allow_change['sg']): ?>
<col style="width: 100px">
<? endif; ?>
</colgroup>
<thead class="hidden-tiny-down">
<tr>
<th><?= _('Fach') ?></th>
<th><?= _('Abschluss') ?></th>
<th id="version_label"><?= _('Versionen') ?></th>
<th id="fachsemester_label"><?= _('Fachsemester') ?></th>
<? if ($allow_change['sg']): ?>
<th style="text-align:center;" id="austragen_label">
<?= _('austragen') ?>
</th>
<? endif; ?>
</tr>
</thead>
<tbody>
<? if (count($user->studycourses) === 0 && $allow_change['sg']): ?>
<tr>
<td colspan="5" style="background: inherit;">
<strong><?= _('Sie haben sich noch keinem Studiengang zugeordnet.') ?></strong><br>
<br>
<?= _('Tragen Sie bitte hier die Angaben aus Ihrem Studierendenausweis ein!') ?>
</td>
</tr>
<? endif; ?>
<? foreach ($user->studycourses as $usc): ?>
<tr>
<td data-label="<?= _('Fach') ?>"><?= htmlReady($usc->studycourse->name) ?></td>
<td data-label="<?= _('Abschluss') ?>"><?= htmlReady($usc->degree->name ?? _('Unbekannt')) ?></td>
<? if ($allow_change['sg']): ?>
<td data-label="<?= _('Versionen') ?>">
<? $versionen = StgteilVersion::findByFachAbschluss($usc->fach_id, $usc->abschluss_id); ?>
<? $versionen = array_filter($versionen, function ($ver) {
return $ver->hasPublicStatus('genehmigt');
}); ?>
<? if (count($versionen)) : ?>
<select name="change_version[<?= htmlReady($usc->fach_id) ?>][<?= htmlReady($usc->abschluss_id) ?>]"
aria-labelledby="version_label">
<option value=""><?= _('-- Bitte Version auswählen --') ?></option>
<? foreach ($versionen as $version) : ?>
<option<?= $version->getId() == $usc->version_id ? ' selected' : '' ?>
value="<?= htmlReady($version->getId()) ?>">
<?= htmlReady($version->getDisplayName()) ?>
</option>
<? endforeach; ?>
</select>
<? else : ?>
<?= tooltipIcon(_('Keine Version in der gewählten Fach-Abschluss-Kombination verfügbar.'), true) ?>
<? endif; ?>
</td>
<? else : ?>
<? $version = StgteilVersion::find($usc->version_id); ?>
<td data-label="<?= _('Versionen') ?>">
<? if ($version && $version->hasPublicStatus('genehmigt')) : ?>
<?= htmlReady($version->getDisplayName()); ?>
<? endif; ?>
</td>
<? endif; ?>
<? if ($allow_change['sg']): ?>
<td data-label="<?= _('Fachsemester') ?>">
<select name="change_fachsem[<?= htmlReady($usc->fach_id) ?>][<?= htmlReady($usc->abschluss_id) ?>]"
aria-labelledby="fachsemester_label">
<? for ($i = 1; $i <= 50; $i += 1): ?>
<option <? if ($i == $usc->semester) echo 'selected'; ?>><?= $i ?></option>
<? endfor; ?>
</select>
</td>
<td data-label="<?= _('austragen') ?>">
<input type="checkbox" aria-labelledby="austragen_label"
name="fach_abschluss_delete[<?= htmlReady($usc->fach_id) ?>]"
value="<?= htmlReady($usc->abschluss_id) ?>">
</td>
<? else: ?>
<td data-label="<?= _('Fachsemester') ?>"><?= htmlReady($usc->semester) ?></td>
<? endif; ?>
</tr>
<? endforeach; ?>
<? if (count($user->studycourses) !== 0 && $allow_change['sg']): ?>
<tr>
<td colspan="5" style="padding: 0; text-align: right;">
<footer>
<?= Button::create(_('Übernehmen'), 'store_in', ['title' => _('Änderungen übernehmen')]) ?>
</footer>
</td>
</tr>
<? endif ?>
</tbody>
</table>
</form>
<? if ($allow_change['sg']): ?>
<form action="<?= $controller->store_sg() ?>" method="post" class="default">
<?= CSRFProtection::tokenTag() ?>
<fieldset>
<legend>
<?= _('Fach / Abschluss hinzufügen') ?>
</legend>
<div>
<?= _('Wählen Sie die Fächer, Abschlüsse und Fachsemester in der folgenden Liste aus:') ?>
</div>
<div class="hgroup">
<label>
<select name="new_studiengang" id="new_studiengang"
aria-label="<?= _('-- Bitte Fach auswählen --') ?>">
<option selected value="none"><?= _('-- Bitte Fach auswählen --') ?></option>
<? foreach ($faecher as $fach) : ?>
<option value="<?= htmlReady($fach->id) ?>">
<?= htmlReady($fach->name) ?>
</option>
<? endforeach ?>
</select>
</label>
<label>
<select name="new_abschluss" id="new_abschluss"
aria-label="<?= _('-- Bitte Abschluss auswählen --') ?>">
<option selected value="none"><?= _('-- Bitte Abschluss auswählen --') ?></option>
<? foreach ($abschluesse as $abschluss) : ?>
<option value="<?= htmlReady($abschluss->id) ?>">
<?= htmlReady($abschluss->name) ?>
</option>
<? endforeach ?>
</select>
</label>
<label>
<select name="fachsem" aria-label="<?= _("Bitte Fachsemester wählen") ?>" class="size-s">
<? for ($i = 1; $i <= 50; $i += 1): ?>
<option><?= $i ?></option>
<? endfor; ?>
</select>
</label>
</div>
</fieldset>
<footer>
<?= Button::create(_('Übernehmen'), 'store_sg', ['title' => _('Änderungen übernehmen')]) ?>
</footer>
</form>
<? else: ?>
<?= _('Die Informationen zu Ihrem Studiengang werden vom System verwaltet, '
. 'und können daher von Ihnen nicht geändert werden.') ?>
<? endif; ?>
|