diff --git a/app/views/course/members/additional.php b/app/views/course/members/additional.php index d1af456c521b38f1741437e33de99ac37360a1e0..0c794584d8a0ff83b8f9417bb2a5ac7aae3aa9ae 100644 --- a/app/views/course/members/additional.php +++ b/app/views/course/members/additional.php @@ -1,34 +1,40 @@ -<? 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 ?> diff --git a/lib/models/AuxLockRule.php b/lib/models/AuxLockRule.php index 3b08a8cc9de71d5a7a4ee77f51f4b7a05af1bed5..80f1e46dcd8f4bc6432e937219abc1eefc4f168d 100644 --- a/lib/models/AuxLockRule.php +++ b/lib/models/AuxLockRule.php @@ -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)); } } } diff --git a/resources/assets/stylesheets/less/forms.less b/resources/assets/stylesheets/less/forms.less index e4f75bafa4328acd931fabc3d3c1a68af6c2d6da..21bb8d0166c74b7696cf35a8a0bfd2ed3ad4a513 100644 --- a/resources/assets/stylesheets/less/forms.less +++ b/resources/assets/stylesheets/less/forms.less @@ -476,12 +476,6 @@ form.narrow { } }); -table.hide_datafield_title { - .datafield_title { - display: none; - } -} - .content-title { background-color: transparent; padding-top: 0px;