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

fixes #1810

Closes #1810

Merge request studip/studip!1190
parent 7648970b
No related branches found
No related tags found
No related merge requests found
<? if (!empty($aux['rows'])) : ?>
<form method="post" action="<?= $controller->url_for('course/members/store_additional')?>">
<?php
/**
* @var array $aux
* @var Course_MembersController $controller
*/
?>
<? if (count($aux['rows']) === 0) : ?>
<?= MessageBox::info(_('Keine Zusatzangaben oder Teilnehmende vorhanden.')) ?>
<? else : ?>
<form method="post" action="<?= $controller->store_additional() ?>">
<?= CSRFProtection::tokenTag()?>
<table class="default hide_datafield_title">
<table class="default">
<caption><?= _('Zusatzangaben bearbeiten') ?></caption>
<thead>
<tr>
<tr>
<? foreach ($aux['head'] as $head): ?>
<th><?= htmlReady($head) ?></th>
<? endforeach; ?>
</tr>
</tr>
</thead>
<tbody>
<? foreach ($aux['rows'] as $entry): ?>
<tr>
<? foreach ($aux['head'] as $key => $value): ?>
<td><?= $key === 'name' ? htmlReady($entry[$key]) : $entry[$key] ?></td>
<? endforeach; ?>
<? foreach ($aux['head'] as $key => $value): ?>
<td><?= $key === 'name' ? htmlReady($entry[$key]) : $entry[$key] ?></td>
<? endforeach; ?>
</tr>
<? endforeach; ?>
</tbody>
<tfoot>
<tr>
<td colspan="<?= count($aux['head']) ?>">
<?= \Studip\Button::create(_('Speichern'), 'save') ?>
</td>
</tr>
<tr>
<td colspan="<?= count($aux['head']) ?>">
<?= Studip\Button::create(_('Speichern'), 'save') ?>
</td>
</tr>
</tfoot>
</table>
</form>
<? else : ?>
<?= MessageBox::info(_('Keine Zusatzangaben oder Teilnehmende vorhanden.')) ?>
<? endif ?>
......@@ -109,7 +109,12 @@ class AuxLockRule extends SimpleORMap
];
// start collecting entries
$result['head']['name'] = _('Name');
$result = [
'head' => [
'name' => _('Name'),
],
'rows' => [],
];
// get all autors and users
foreach ($course->members->findBy('status', ['autor', 'user'])->orderBy('nachname,vorname') as $member) {
......@@ -121,7 +126,7 @@ class AuxLockRule extends SimpleORMap
// if standard get it from the mapping else get it from the datafield
if ($mapping[$field]) {
$result['head'][$field] = $head_mapping[$field];
$new[$field] = $mapping[$field];
$new[$field] = htmlReady($mapping[$field]);
} else {
$datafield = $this->getDatafield($member, $field);
if ($datafield && current($datafield)->isVisible()) {
......@@ -129,7 +134,7 @@ class AuxLockRule extends SimpleORMap
if (!$display_only && current($datafield)->isEditable() && $this->datafieldCache[$field]->object_type == 'usersemdata') {
$new[$field] = current($datafield)->getHTML($member->user_id);
} else {
$new[$field] = current($datafield)->getDisplayValue(false);
$new[$field] = htmlReady(current($datafield)->getDisplayValue(false));
}
}
}
......
......@@ -476,12 +476,6 @@ form.narrow {
}
});
table.hide_datafield_title {
.datafield_title {
display: none;
}
}
.content-title {
background-color: transparent;
padding-top: 0px;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment