aboutsummaryrefslogtreecommitdiff
path: root/app/views/admin/user/show_user_courses.php
blob: 9d1d3f0062073d71e0526de7f49348f79d40a082 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<?php
/**
 * @var Admin_UserController $controller
 * @var User $user
 */
?>
<? if (!empty($sem_courses)) : ?>
    <form method="post" action="<?= $controller->delete_course_assignment($user) ?>" class="default collapsable"
          data-dialog="size=auto">
        <?= CSRFProtection::tokenTag() ?>
        <? foreach ($sem_courses as $sem_name => $courses) : ?>
            <fieldset>
                <legend>
                    <?= htmlReady($sem_name) ?>
                </legend>
                <table class="default ">
                    <colgroup>
                        <col style="width: 20px">
                        <col>
                        <col>
                    </colgroup>
                    <thead>
                        <tr>
                            <th>
                                <input type="checkbox" name="all" value="1" title="<?= _('Alle Veranstaltungen auswählen') ?>"
                                       data-proxyfor="tbody#courses-<?= md5($sem_name) ?> td :checkbox">
                            </th>
                            <th><?= _('Veranstaltungsname') ?></th>
                            <th class="actions"><?= _('Aktionen') ?></th>
                        </tr>
                    </thead>
                    <tbody id="courses-<?= md5($sem_name) ?>">
                        <? foreach ($courses as $course) : ?>
                            <tr>
                                <td>
                                    <input type="checkbox" name="courses[]" value="<?= htmlReady($course->id) ?>"
                                    title="<?= sprintf(_('%s auswählen'), htmlReady($course->getFullName())) ?>">
                                </td>
                                <td><?= htmlReady($course->getFullName()) ?></td>
                                <td class="actions">
                                    <?= Icon::create('trash')->asInput([
                                        'formaction'   => $controller->delete_course_assignment(
                                            $user,
                                            ['course_id' => $course->id]
                                        ),
                                        'data-confirm' => sprintf(
                                            _('Wollen Sie %s wirklich austragen?'),
                                            htmlReady($user->getFullName())
                                        ),
                                        'title' => sprintf(
                                            _('Aus %s austragen'),
                                            htmlReady($course->getFullName())
                                        ),
                                        'data-dialog'  => 'size=auto'
                                    ]) ?>
                                </td>
                            </tr>
                        <? endforeach ?>
                    </tbody>
                </table>
            </fieldset>
        <? endforeach ?>
        <footer data-dialog-button>
            <?= \Studip\Button::create(
                _('Austragen'),
                'delete_assignments',
                [
                    'data-confirm' => sprintf(
                        _('Wollen Sie %s wirklich austragen?'),
                        $user->getFullName()
                    )
                ]
            ) ?>
        </footer>
    </form>
<? else : ?>
    <?= MessageBox::info(_('Es wurden keine Veranstaltungen gefunden.')) ?>
<? endif ?>