Skip to content
Snippets Groups Projects
Commit cc4ded2e authored by Elmar Ludwig's avatar Elmar Ludwig
Browse files

sort member export, display date in table, fixes #163

parent 3cee8ada
No related branches found
No related tags found
No related merge requests found
...@@ -69,7 +69,7 @@ class GroupsController extends StudipController ...@@ -69,7 +69,7 @@ class GroupsController extends StudipController
# get all course participants # # get all course participants #
################################# #################################
$members = CourseMember::findByCourseAndStatus($course_id, 'autor'); $members = Context::get()->members->findBy('status', 'autor')->orderBy('nachname, vorname');
foreach ($members as $member) { foreach ($members as $member) {
$group = VipsGroup::getUserGroup($member->user_id, $course_id); $group = VipsGroup::getUserGroup($member->user_id, $course_id);
...@@ -453,12 +453,12 @@ class GroupsController extends StudipController ...@@ -453,12 +453,12 @@ class GroupsController extends StudipController
*/ */
public function export_groups_action() public function export_groups_action()
{ {
$columns = [_vips('Nachname'), _vips('Vorname'), _vips('Gruppe'), _vips('Datum')]; $columns = [_vips('Nachname'), _vips('Vorname'), _vips('Gruppe'), _vips('Anmeldedatum')];
$data = [$columns]; $data = [$columns];
$course_id = Context::getId(); $course_id = Context::getId();
vips_require_status('tutor', $course_id); vips_require_status('tutor', $course_id);
$members = CourseMember::findByCourseAndStatus($course_id, 'autor'); $members = Context::get()->members->findBy('status', 'autor')->orderBy('nachname, vorname');
foreach ($members as $member) { foreach ($members as $member) {
$group = VipsGroup::getUserGroup($member->user_id, $course_id); $group = VipsGroup::getUserGroup($member->user_id, $course_id);
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<table class="default width-1200"> <table class="default width-1200">
<caption> <caption>
<?= htmlReady($group->name) ?> <?= htmlReady($group->name) ?> (<?= count($group->current_members) ?>/<?= $group->size ?>)
<? if ($is_tutor) :?> <? if ($is_tutor) :?>
<div class="actions"> <div class="actions">
<? $menu = ActionMenu::get() ?> <? $menu = ActionMenu::get() ?>
...@@ -63,9 +63,14 @@ ...@@ -63,9 +63,14 @@
<input type="checkbox" data-proxyfor=".batch_select_<?= $i ?>" data-activates=".batch_action_<?= $i ?>" title="<?= _vips('Alle Personen auswählen') ?>"> <input type="checkbox" data-proxyfor=".batch_select_<?= $i ?>" data-activates=".batch_action_<?= $i ?>" title="<?= _vips('Alle Personen auswählen') ?>">
</th> </th>
<? endif ?> <? endif ?>
<th> <th style="width: 60%;">
<?= sprintf(_vips('Teilnehmer (max. %d)'), $group->size) ?> <?= _vips('Nachname, Vorname') ?>
</th> </th>
<? if ($is_tutor): ?>
<th style="width: 20%;">
<?= _vips('Anmeldedatum') ?>
</th>
<? endif ?>
<th class="actions"> <th class="actions">
<?= _vips('Aktionen') ?> <?= _vips('Aktionen') ?>
</th> </th>
...@@ -86,6 +91,11 @@ ...@@ -86,6 +91,11 @@
<?= htmlReady($fullname) ?> <?= htmlReady($fullname) ?>
</a> </a>
</td> </td>
<? if ($is_tutor): ?>
<td>
<?= date('d.m.Y, H:i', strtotime($member->start)) ?>
</td>
<? endif ?>
<td class="actions"> <td class="actions">
<? $menu = ActionMenu::get() ?> <? $menu = ActionMenu::get() ?>
<? if ($is_tutor || $group->id === $user_group->id): ?> <? if ($is_tutor || $group->id === $user_group->id): ?>
...@@ -108,7 +118,7 @@ ...@@ -108,7 +118,7 @@
<? if ($is_tutor && count($group->current_members)): ?> <? if ($is_tutor && count($group->current_members)): ?>
<tfoot> <tfoot>
<tr> <tr>
<td colspan="3"> <td colspan="4">
<? if (count($groups) > 1): ?> <? if (count($groups) > 1): ?>
<?= Studip\Button::create(_vips('Verschieben'), 'move_participants', [ <?= Studip\Button::create(_vips('Verschieben'), 'move_participants', [
'class' => 'batch_action_' . $i, 'class' => 'batch_action_' . $i,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment