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

fixes #429

parent 846f65c4
No related branches found
No related tags found
No related merge requests found
...@@ -2,23 +2,23 @@ ...@@ -2,23 +2,23 @@
<h2><?= _('Meine Einrichtungen:') ?></h2> <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() ?>"> <input type="hidden" name="studip_ticket" value="<?= get_ticket() ?>">
<?= CSRFProtection::tokenTag() ?> <?= CSRFProtection::tokenTag() ?>
<table class="default" id="select_institute"> <table class="default" id="select_institute">
<colgroup> <colgroup>
<col> <col>
<col width="100px"> <? if ($allow_change['in']): ?>
<col style="width: 100px">
<? endif; ?>
</colgroup> </colgroup>
<thead> <thead>
<tr> <tr>
<th><?= _('Einrichtung') ?></th> <th><?= _('Einrichtung') ?></th>
<th> <? if ($allow_change['in']): ?>
<? if ($allow_change['in']): ?> <th><?= _('austragen') ?></th>
<?= _('austragen') ?> <? endif; ?>
<? endif; ?>
</th>
</thead> </thead>
<tbody> <tbody>
<? if (count($institutes) === 0 && $allow_change['in']): ?> <? if (count($institutes) === 0 && $allow_change['in']): ?>
...@@ -36,32 +36,30 @@ ...@@ -36,32 +36,30 @@
<td> <td>
<label for="inst_delete_<?= $inst_member->institute->id ?>"><?= htmlReady($inst_member->institute->name) ?></label> <label for="inst_delete_<?= $inst_member->institute->id ?>"><?= htmlReady($inst_member->institute->name) ?></label>
</td> </td>
<td style="text-align:center"> <? if ($allow_change['in']): ?>
<? if ($allow_change['in']): ?> <td style="text-align: center">
<input type="checkbox" name="inst_delete[]" id="inst_delete_<?= $inst_member->institute->id ?>" <input type="checkbox" name="inst_delete[]" id="inst_delete_<?= htmlReady($inst_member->institute->id) ?>"
value="<?= $inst_member->institute->id ?>"> value="<?= htmlReady($inst_member->institute->id) ?>">
<? else: ?>
<?= Icon::create('accept', 'inactive')->asImg(['class' => 'text-top']) ?>
<? endif; ?>
</td> </td>
<? endif; ?>
</tr> </tr>
<? endforeach; ?> <? endforeach; ?>
<? if (count($institutes) !== 0 && $allow_change['in']): ?> <? if (count($institutes) !== 0 && $allow_change['in']): ?>
<tr> <tr>
<td colspan="2" style="padding: 0px; text-align: right;"> <td colspan="2" style="padding: 0; text-align: right;">
<footer> <footer>
<?= Button::create(_('Übernehmen'), 'store_in', ['title' => _('Änderungen übernehmen')]) ?> <?= Button::create(_('Übernehmen'), 'store_in', ['title' => _('Änderungen übernehmen')]) ?>
</footer> </footer>
</td> </td>
</tr> </tr>
<? endif ?> <? endif ?>
</tbody> </tbody>
</table> </table>
</form> </form>
<? if ($allow_change['in']): ?> <? 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() ?>"> <input type="hidden" name="studip_ticket" value="<?= get_ticket() ?>">
<?= CSRFProtection::tokenTag() ?> <?= CSRFProtection::tokenTag() ?>
<fieldset> <fieldset>
...@@ -83,11 +81,11 @@ ...@@ -83,11 +81,11 @@
): ?> ): ?>
<option class="<?= $i['is_fak'] ? 'nested-item-header' : 'nested-item' ?>" <option class="<?= $i['is_fak'] ? 'nested-item-header' : 'nested-item' ?>"
value="<?= htmlReady($i['Institut_id']) ?>"> value="<?= htmlReady($i['Institut_id']) ?>">
<?= htmlReady(my_substr($i['Name'], 0, 70)) ?> <?= htmlReady($i['Name']) ?>
</option> </option>
<? else: ?> <? else: ?>
<option class="<?= $i['is_fak'] ? 'nested-item-header' : 'nested-item' ?>" disabled> <option class="<?= $i['is_fak'] ? 'nested-item-header' : 'nested-item' ?>" disabled>
<?= htmlReady(my_substr($i['Name'], 0, 70)) ?> <?= htmlReady($i['Name']) ?>
</option> </option>
<? endif; ?> <? endif; ?>
<? endforeach; ?> <? endforeach; ?>
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<h2><?= _('Ich studiere folgende Fächer und Abschlüsse:') ?></h2> <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() ?> <?= CSRFProtection::tokenTag() ?>
<table class="default" id="select_fach_abschluss"> <table class="default" id="select_fach_abschluss">
...@@ -10,8 +10,10 @@ ...@@ -10,8 +10,10 @@
<col> <col>
<col> <col>
<col> <col>
<col width="100px"> <col style="width: 100px">
<col width="100px"> <? if ($allow_change['sg']): ?>
<col style="width: 100px">
<? endif; ?>
</colgroup> </colgroup>
<thead class="hidden-tiny-down"> <thead class="hidden-tiny-down">
<tr> <tr>
...@@ -19,17 +21,15 @@ ...@@ -19,17 +21,15 @@
<th><?= _('Abschluss') ?></th> <th><?= _('Abschluss') ?></th>
<th id="version_label"><?= _('Versionen') ?></th> <th id="version_label"><?= _('Versionen') ?></th>
<th id="fachsemester_label"><?= _('Fachsemester') ?></th> <th id="fachsemester_label"><?= _('Fachsemester') ?></th>
<? if ($allow_change['sg']): ?>
<th style="text-align:center;" id="austragen_label"> <th style="text-align:center;" id="austragen_label">
<? if ($allow_change['sg']): ?> <?= _('austragen') ?>
<?= _('austragen') ?>
<? else: ?>
&nbsp;
<? endif; ?>
</th> </th>
<? endif; ?>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<? if (count($user->studycourses) === 0 && $allow_change['sg']): ?> <? if (count($user->studycourses) === 0 && $allow_change['sg']): ?>
<tr> <tr>
<td colspan="5" style="background: inherit;"> <td colspan="5" style="background: inherit;">
<strong><?= _('Sie haben sich noch keinem Studiengang zugeordnet.') ?></strong><br> <strong><?= _('Sie haben sich noch keinem Studiengang zugeordnet.') ?></strong><br>
...@@ -37,73 +37,70 @@ ...@@ -37,73 +37,70 @@
<?= _('Tragen Sie bitte hier die Angaben aus Ihrem Studierendenausweis ein!') ?> <?= _('Tragen Sie bitte hier die Angaben aus Ihrem Studierendenausweis ein!') ?>
</td> </td>
</tr> </tr>
<? endif; ?> <? endif; ?>
<? foreach ($user->studycourses as $usc): ?> <? foreach ($user->studycourses as $usc): ?>
<tr> <tr>
<td data-label="<?= _('Fach') ?>"><?= htmlReady($usc->studycourse->name) ?></td> <td data-label="<?= _('Fach') ?>"><?= htmlReady($usc->studycourse->name) ?></td>
<td data-label="<?= _('Abschluss') ?>"><?= htmlReady($usc->degree->name) ?></td> <td data-label="<?= _('Abschluss') ?>"><?= htmlReady($usc->degree->name) ?></td>
<? if ($allow_change['sg']): ?> <? if ($allow_change['sg']): ?>
<td data-label="<?= _('Version') ?>"> <td data-label="<?= _('Versionen') ?>">
<? $versionen = StgteilVersion::findByFachAbschluss($usc->fach_id, $usc->abschluss_id); ?> <? $versionen = StgteilVersion::findByFachAbschluss($usc->fach_id, $usc->abschluss_id); ?>
<? $versionen = array_filter($versionen, function ($ver) { <? $versionen = array_filter($versionen, function ($ver) {
return $ver->hasPublicStatus('genehmigt'); return $ver->hasPublicStatus('genehmigt');
}); ?> }); ?>
<? if (count($versionen)) : ?> <? 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"> aria-labelledby="version_label">
<option value=""><?= _('-- Bitte Version auswählen --') ?></option> <option value=""><?= _('-- Bitte Version auswählen --') ?></option>
<? foreach ($versionen as $version) : ?> <? foreach ($versionen as $version) : ?>
<option<?= $version->getId() == $usc->version_id ? ' selected' : '' ?> <option<?= $version->getId() == $usc->version_id ? ' selected' : '' ?>
value="<?= htmlReady($version->getId()) ?>"> value="<?= htmlReady($version->getId()) ?>">
<?= htmlReady($version->getDisplayName()) ?> <?= htmlReady($version->getDisplayName()) ?>
</option> </option>
<? endforeach; ?> <? 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>
<? if ($version && $version->hasPublicStatus('genehmigt')) : ?>
<?= htmlReady($version->getDisplayName()); ?>
<? endif; ?>
</td>
<? endif; ?>
<? if ($allow_change['sg']): ?>
<td data-label="<?= _('Fachsemester') ?>">
<select name="change_fachsem[<?= $usc->fach_id?>][<?= $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> </select>
</td> <? else : ?>
<td data-label="<?= _('austragen:') ?>"> <?= tooltipIcon(_('Keine Version in der gewählten Fach-Abschluss-Kombination verfügbar.'), true) ?>
<input type="checkbox" aria-labelledby="austragen_label" <? endif; ?>
name="fach_abschluss_delete[<?= $usc->fach_id ?>]" </td>
value="<?= $usc->abschluss_id ?>"> <? else : ?>
</td> <? $version = StgteilVersion::find($usc->version_id); ?>
<? else: ?> <td data-label="<?= _('Versionen') ?>">
<td data-label="<?= _('Fachsemester:') ?>"><?= htmlReady($usc->semester) ?></td> <? if ($version && $version->hasPublicStatus('genehmigt')) : ?>
<td data-label="<?= _('austragen:') ?>" style="text-align: right;"> <?= htmlReady($version->getDisplayName()); ?>
<?= Icon::create('accept', 'inactive')->asImg(['class' => 'text-top']) ?>
</td>
<? endif; ?> <? 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> </tr>
<? endforeach; ?> <? endforeach; ?>
<? if (count($user->studycourses) !== 0 && $allow_change['sg']): ?> <? if (count($user->studycourses) !== 0 && $allow_change['sg']): ?>
<tr> <tr>
<td colspan="5" style="padding: 0px; text-align: right;"> <td colspan="5" style="padding: 0; text-align: right;">
<footer> <footer>
<?= Button::create(_('Übernehmen'), 'store_in', ['title' => _('Änderungen übernehmen')]) ?> <?= Button::create(_('Übernehmen'), 'store_in', ['title' => _('Änderungen übernehmen')]) ?>
</footer> </footer>
</td> </td>
</tr> </tr>
<? endif ?> <? endif ?>
</tbody> </tbody>
</table> </table>
...@@ -111,7 +108,7 @@ ...@@ -111,7 +108,7 @@
<? if ($allow_change['sg']): ?> <? 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() ?> <?= CSRFProtection::tokenTag() ?>
<fieldset> <fieldset>
...@@ -128,9 +125,11 @@ ...@@ -128,9 +125,11 @@
<select name="new_studiengang" id="new_studiengang" <select name="new_studiengang" id="new_studiengang"
aria-label="<?= _('-- Bitte Fach auswählen --') ?>"> aria-label="<?= _('-- Bitte Fach auswählen --') ?>">
<option selected value="none"><?= _('-- Bitte Fach auswählen --') ?></option> <option selected value="none"><?= _('-- Bitte Fach auswählen --') ?></option>
<? foreach ($faecher as $fach) : ?> <? foreach ($faecher as $fach) : ?>
<?= sprintf('<option value="%s">%s</option>', $fach->id, htmlReady(my_substr($fach->name, 0, 50))); ?> <option value="<?= htmlReady($fach->id) ?>">
<? endforeach ?> <?= htmlReady($fach->name) ?>
</option>
<? endforeach ?>
</select> </select>
</label> </label>
...@@ -138,17 +137,19 @@ ...@@ -138,17 +137,19 @@
<select name="new_abschluss" id="new_abschluss" <select name="new_abschluss" id="new_abschluss"
aria-label="<?= _('-- Bitte Abschluss auswählen --') ?>"> aria-label="<?= _('-- Bitte Abschluss auswählen --') ?>">
<option selected value="none"><?= _('-- Bitte Abschluss auswählen --') ?></option> <option selected value="none"><?= _('-- Bitte Abschluss auswählen --') ?></option>
<? foreach ($abschluesse as $abschluss) : ?> <? 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) ?>">
<? endforeach ?> <?= htmlReady($abschluss->name) ?>
</option>
<? endforeach ?>
</select> </select>
</label> </label>
<label> <label>
<select name="fachsem" aria-label="<?= _("Bitte Fachsemester wählen") ?>" class="size-s"> <select name="fachsem" aria-label="<?= _("Bitte Fachsemester wählen") ?>" class="size-s">
<? for ($i = 1; $i <= 50; $i += 1): ?> <? for ($i = 1; $i <= 50; $i += 1): ?>
<option><?= $i ?></option> <option><?= $i ?></option>
<? endfor; ?> <? endfor; ?>
</select> </select>
</label> </label>
</div> </div>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment