aboutsummaryrefslogtreecommitdiff
path: root/app/views/my_courses/waiting_list.php
blob: 3ac47ed74bac83d86751cf47d732c0e3c2828dcb (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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
<?php
/***
 * @var array $waiting_list
 * @var MyCoursesController $controller
 */

?>

<? if (!empty($waiting_list)) : ?>
    <table class="default collapsable" id="my_waitlists">
        <caption>
            <?= _('Anmelde- und Wartelisteneinträge') ?>
        </caption>
        <colgroup class="hidden-small-down">
            <col style="width: 1px">
            <col style="width: 65%">
            <col style="width: 7%">
            <col style="width: 10%">
            <col style="width: 10%">
            <col style="width: 15%">
            <col style="width: 3%">
        </colgroup>
        <colgroup class="hidden-medium-up">
            <col style="width: 1px">
        </colgroup>

        <thead>
        <tr>
            <th></th>
            <th style="text-align: left"><?= _('Name') ?></th>
            <th class="hidden-small-down"><?= _('Inhalt') ?></th>
            <th style="text-align: center"><?= _('Datum') ?></th>
            <th class="hidden-small-down"
                style="text-wrap: nowrap; white-space: nowrap"><?= _('Position') ?></th>
            <th class="hidden-small-down"><?= _('Art') ?></th>
            <th></th>
        </tr>
        </thead>
        <tbody>
        <? foreach ($waiting_list as $wait) : ?>

            <?php
            // wir sind in einer Anmeldeliste, also keine Wahrscheinlichkeit zuverlässig berechenbar
            if ($wait['status'] === 'claiming') {
                $chance_color = 'ff';
            } // wir sind in einer Warteliste
            else {
                $chance_color = $wait['position'] < 30 ? dechex(255 - $wait['position'] * 6) : 44;
            }

            $seminar_name = $wait["Name"];
            if (!empty($wait['sem_status']) && SeminarCategories::GetByTypeId($wait['sem_status'])->studygroup_mode) {
                $seminar_name .= ' (' . _('Studiengruppe') . ', ' . _('geschlossen') . ')';
            }
            ?>
            <tr>
                <td title="<?= _('Position') ?>" style="background:#44<?= $chance_color ?>44">
                </td>

                <td>
                    <a href="<?= URLHelper::getLink('dispatch.php/course/details/', [
                        'sem_id'                => $wait['seminar_id'],
                        'send_from_search_page' => 'dispatch.php/my_courses/index',
                        'send_from_search'      => 'TRUE'
                    ]) ?>">
                        <?= htmlReady($seminar_name) ?>
                    </a>
                    <?php if ($wait['status'] === 'claiming') : ?>
                        <br>
                        <?= sprintf(_('Priorität %1$u im Anmeldeset "%2$s"'), $wait['priority'], $wait['cname']) ?>
                    <?php endif ?>
                </td>
                <td class="hidden-small-down">
                    <a data-dialog="size=auto"
                       href="<?= $controller->link_for('course/details/index', $wait['seminar_id']) ?>"
                    >
                        <? $params = tooltip2(_('Veranstaltungsdetails anzeigen')) ?>
                        <?= Icon::create('info-circle', Icon::ROLE_INACTIVE)->asSvg(['style' => 'cursor: pointer']) ?>
                    </a>
                </td>
                <td style="text-align: center">
                    <?= $wait['status'] === 'claiming' ? date('d.m.', $wait['admission_endtime']) : "-" ?>
                </td>

                <td class="hidden-small-down" style="text-align: center">
                    <?= $wait['status'] === 'claiming' ? '-' : $wait['position'] ?>
                </td>

                <td class="hidden-small-down" style="text-align: center">
                    <? if ($wait['status'] === 'claiming') : ?>
                        <?= _('Autom.') ?>
                    <? elseif ($wait['status'] === 'accepted') : ?>
                        <?= _('Vorl.') ?>
                    <? else: ?>
                        <?= _('Wartel.') ?>
                    <? endif ?>
                </td>

                <td style="text-align: right">
                    <? if ($wait['status'] === 'accepted' && $wait['admission_binding']) : ?>
                        <a href="<?= $controller->url_for('my_courses/decline_binding') ?>">
                            <?= Icon::create('door-leave', Icon::ROLE_INACTIVE)->asSvg(['title' => _('Die Teilnahme ist bindend. Bitte wenden Sie sich an die Lehrenden.')]) ?>
                        </a>
                    <? else : ?>
                        <a href="<?= $controller->link_for('my_courses/decline', $wait['seminar_id'], ['cmd' => 'suppose_to_kill_admission']) ?>">
                            <?= Icon::create('door-leave', Icon::ROLE_INACTIVE)->asSvg(['title' => _('Aus der Veranstaltung abmelden')]) ?>
                        </a>
                    <? endif ?>
                </td>
            </tr>
        <? endforeach ?>
        </tbody>
    </table>
    <br>
    <br>
<? endif ?>