Skip to content
Snippets Groups Projects
Commit 079eac64 authored by Jan-Hendrik Willms's avatar Jan-Hendrik Willms
Browse files

fixes #429

parent 6c6bbe57
No related branches found
No related tags found
No related merge requests found
......@@ -2,23 +2,23 @@
<h2><?= _('Meine Einrichtungen:') ?></h2>
<form action="<?= $controller->url_for('settings/studies/store_in') ?>" method="post" class="default">
<form action="<?= $controller->store_in() ?>" method="post" class="default">
<input type="hidden" name="studip_ticket" value="<?= get_ticket() ?>">
<?= CSRFProtection::tokenTag() ?>
<table class="default" id="select_institute">
<colgroup>
<col>
<col width="100px">
<? if ($allow_change['in']): ?>
<col style="width: 100px">
<? endif; ?>
</colgroup>
<thead>
<tr>
<th><?= _('Einrichtung') ?></th>
<th>
<? if ($allow_change['in']): ?>
<?= _('austragen') ?>
<th><?= _('austragen') ?></th>
<? endif; ?>
</th>
</thead>
<tbody>
<? if (count($institutes) === 0 && $allow_change['in']): ?>
......@@ -36,20 +36,18 @@
<td>
<label for="inst_delete_<?= $inst_member->institute->id ?>"><?= htmlReady($inst_member->institute->name) ?></label>
</td>
<td style="text-align:center">
<? if ($allow_change['in']): ?>
<input type="checkbox" name="inst_delete[]" id="inst_delete_<?= $inst_member->institute->id ?>"
value="<?= $inst_member->institute->id ?>">
<? else: ?>
<?= Icon::create('accept', 'inactive')->asImg(['class' => 'text-top']) ?>
<? endif; ?>
<td style="text-align: center">
<input type="checkbox" name="inst_delete[]" id="inst_delete_<?= htmlReady($inst_member->institute->id) ?>"
value="<?= htmlReady($inst_member->institute->id) ?>">
</td>
<? endif; ?>
</tr>
<? endforeach; ?>
<? if (count($institutes) !== 0 && $allow_change['in']): ?>
<tr>
<td colspan="2" style="padding: 0px; text-align: right;">
<td colspan="2" style="padding: 0; text-align: right;">
<footer>
<?= Button::create(_('Übernehmen'), 'store_in', ['title' => _('Änderungen übernehmen')]) ?>
</footer>
......@@ -61,7 +59,7 @@
</form>
<? if ($allow_change['in']): ?>
<form action="<?= $controller->url_for('settings/studies/store_in') ?>" method="post" class="default">
<form action="<?= $controller->store_in() ?>" method="post" class="default">
<input type="hidden" name="studip_ticket" value="<?= get_ticket() ?>">
<?= CSRFProtection::tokenTag() ?>
<fieldset>
......@@ -83,11 +81,11 @@
): ?>
<option class="<?= $i['is_fak'] ? 'nested-item-header' : 'nested-item' ?>"
value="<?= htmlReady($i['Institut_id']) ?>">
<?= htmlReady(my_substr($i['Name'], 0, 70)) ?>
<?= htmlReady($i['Name']) ?>
</option>
<? else: ?>
<option class="<?= $i['is_fak'] ? 'nested-item-header' : 'nested-item' ?>" disabled>
<?= htmlReady(my_substr($i['Name'], 0, 70)) ?>
<?= htmlReady($i['Name']) ?>
</option>
<? endif; ?>
<? endforeach; ?>
......
......@@ -2,7 +2,7 @@
<h2><?= _('Ich studiere folgende Fächer und Abschlüsse:') ?></h2>
<form action="<?= $controller->url_for('settings/studies/store_sg') ?>" method="post" class="default">
<form action="<?= $controller->store_sg() ?>" method="post" class="default">
<?= CSRFProtection::tokenTag() ?>
<table class="default" id="select_fach_abschluss">
......@@ -10,8 +10,10 @@
<col>
<col>
<col>
<col width="100px">
<col width="100px">
<col style="width: 100px">
<? if ($allow_change['sg']): ?>
<col style="width: 100px">
<? endif; ?>
</colgroup>
<thead class="hidden-tiny-down">
<tr>
......@@ -19,13 +21,11 @@
<th><?= _('Abschluss') ?></th>
<th id="version_label"><?= _('Versionen') ?></th>
<th id="fachsemester_label"><?= _('Fachsemester') ?></th>
<th style="text-align:center;" id="austragen_label">
<? if ($allow_change['sg']): ?>
<th style="text-align:center;" id="austragen_label">
<?= _('austragen') ?>
<? else: ?>
&nbsp;
<? endif; ?>
</th>
<? endif; ?>
</tr>
</thead>
<tbody>
......@@ -45,13 +45,13 @@
<td data-label="<?= _('Fach') ?>"><?= htmlReady($usc->studycourse->name) ?></td>
<td data-label="<?= _('Abschluss') ?>"><?= htmlReady($usc->degree->name) ?></td>
<? if ($allow_change['sg']): ?>
<td data-label="<?= _('Version') ?>">
<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[<?= $usc->fach_id ?>][<?= $usc->abschluss_id ?>]"
<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) : ?>
......@@ -67,7 +67,7 @@
</td>
<? else : ?>
<? $version = StgteilVersion::find($usc->version_id); ?>
<td>
<td data-label="<?= _('Versionen') ?>">
<? if ($version && $version->hasPublicStatus('genehmigt')) : ?>
<?= htmlReady($version->getDisplayName()); ?>
<? endif; ?>
......@@ -75,30 +75,27 @@
<? endif; ?>
<? if ($allow_change['sg']): ?>
<td data-label="<?= _('Fachsemester') ?>">
<select name="change_fachsem[<?= $usc->fach_id?>][<?= $usc->abschluss_id ?>]"
<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:') ?>">
<td data-label="<?= _('austragen') ?>">
<input type="checkbox" aria-labelledby="austragen_label"
name="fach_abschluss_delete[<?= $usc->fach_id ?>]"
value="<?= $usc->abschluss_id ?>">
name="fach_abschluss_delete[<?= htmlReady($usc->fach_id) ?>]"
value="<?= htmlReady($usc->abschluss_id) ?>">
</td>
<? else: ?>
<td data-label="<?= _('Fachsemester:') ?>"><?= htmlReady($usc->semester) ?></td>
<td data-label="<?= _('austragen:') ?>" style="text-align: right;">
<?= Icon::create('accept', 'inactive')->asImg(['class' => 'text-top']) ?>
</td>
<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: 0px; text-align: right;">
<td colspan="5" style="padding: 0; text-align: right;">
<footer>
<?= Button::create(_('Übernehmen'), 'store_in', ['title' => _('Änderungen übernehmen')]) ?>
</footer>
......@@ -111,7 +108,7 @@
<? if ($allow_change['sg']): ?>
<form action="<?= $controller->url_for('settings/studies/store_sg') ?>" method="post" class="default">
<form action="<?= $controller->store_sg() ?>" method="post" class="default">
<?= CSRFProtection::tokenTag() ?>
<fieldset>
......@@ -129,7 +126,9 @@
aria-label="<?= _('-- Bitte Fach auswählen --') ?>">
<option selected value="none"><?= _('-- Bitte Fach auswählen --') ?></option>
<? foreach ($faecher as $fach) : ?>
<?= sprintf('<option value="%s">%s</option>', $fach->id, htmlReady(my_substr($fach->name, 0, 50))); ?>
<option value="<?= htmlReady($fach->id) ?>">
<?= htmlReady($fach->name) ?>
</option>
<? endforeach ?>
</select>
</label>
......@@ -139,7 +138,9 @@
aria-label="<?= _('-- Bitte Abschluss auswählen --') ?>">
<option selected value="none"><?= _('-- Bitte Abschluss auswählen --') ?></option>
<? foreach ($abschluesse as $abschluss) : ?>
<?= sprintf('<option value="%s">%s</option>' . "\n", $abschluss->id, htmlReady(my_substr($abschluss->name, 0, 50))); ?>
<option value="<?= htmlReady($abschluss->id) ?>">
<?= htmlReady($abschluss->name) ?>
</option>
<? endforeach ?>
</select>
</label>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment