aboutsummaryrefslogtreecommitdiff
path: root/app/views/course/connectedcourses/index.php
blob: fa8006bae9c0528c161b6a78bcb47015a2d6657f (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
<? if (count($connected) + count($proposals) > 0) : ?>
    <? if (count($connected) > 0) : ?>
        <form method="post">
            <?= CSRFProtection::tokenTag() ?>
            <table class="default">
                <caption>
                    <?= _('Verknüpfte Veranstaltungen') ?>
                    <thead>
                    <tr>
                        <th><?= _('Name') ?></th>
                        <th class="actions"><?= _('Aktion') ?></th>
                    </tr>
                    </thead>
                    <tbody>
                    <? foreach ($connected as $connection) : ?>
                        <tr>
                            <td>
                                <a href="<?= URLHelper::getLink('dispatch.php/course/details/' . $connection['course_id']) ?>" target="_blank">
                                    <?= CourseAvatar::getAvatar($connection['course_id'])->getImageTag(Avatar::SMALL) ?>
                                    <?= htmlReady($connection->course->getFullName()) ?>
                                </a>
                            </td>
                            <td class="actions">
                                <?= Icon::create('trash')->asInput([
                                    'title' => _('Verknüpfung aufheben'),
                                    'data-confirm' => _('Wirklich die Zuweisung zu der Veranstaltung aufheben?'),
                                    'formaction' => $controller->url_for('course/connectedcourses/remove/'.$connection['course_id'])
                                ]) ?>
                            </td>
                        </tr>
                    <? endforeach ?>
                    </tbody>
                </caption>
            </table>
        </form>
    <? endif ?>

    <? if (count($proposals) > 0) : ?>
        <form method="post">
            <?= CSRFProtection::tokenTag() ?>
            <table class="default">
                <caption>
                    <?= _('Eingereichte Vorschläge') ?>
                </caption>
                <thead>
                <tr>
                    <th><?= _('Name') ?></th>
                    <th><?= _('Vorgeschlagen von') ?></th>
                    <th class="actions"><?= _('Aktion') ?></th>
                </tr>
                </thead>
                <tbody>
                <? foreach ($proposals as $proposal) : ?>
                    <tr>
                        <td>
                            <a href="<?= URLHelper::getLink('dispatch.php/course/details/' . $connection['course_id']) ?>" target="_blank">
                                <?= CourseAvatar::getAvatar($proposal['course_id'])->getImageTag(Avatar::SMALL) ?>
                                <?= htmlReady($proposal->course->getFullName()) ?>
                            </a>
                        </td>
                        <td>
                            <?= htmlReady($proposal->user->getFullName()) ?>
                        </td>
                        <td class="actions">
                            <? if ($proposal['proposed_from'] === 'course') : ?>
                                <?= Icon::create('accept')->asInput([
                                    'title'        => _('Vorschlag annehmen'),
                                    'data-confirm' => _('Wirklich die Veranstaltung mit dieser Studiengruppe verknüpfen?'),
                                    'formaction'   => $controller->connectURL($proposal['course_id'])
                                ]) ?>
                            <? endif ?>
                            <? if ($proposal['proposed_from'] === 'course') : ?>
                                <?= Icon::create('decline')->asInput([
                                    'title'        => _('Vorschlag ablehnen'),
                                    'data-confirm' => _('Wirklich den Vorschlag ablehnen?'),
                                    'formaction'   => $controller->declineURL($proposal->id)
                                ]) ?>
                            <? else : ?>
                                <?= Icon::create('decline')->asInput([
                                    'title'        => _('Vorschlag zurückziehen'),
                                    'data-confirm' => _('Wirklich den Vorschlag zurückziehen?'),
                                    'formaction'   => $controller->declineURL($proposal->id)
                                ]) ?>
                            <? endif ?>
                        </td>
                    </tr>
                <? endforeach ?>
                </tbody>
            </table>
        </form>
    <? endif ?>

<? else : ?>

    <div class="studip-contents-overview-teaser">
        <div class="teaser-content">

            <div>
                <header><?= _('Verknüpfung zu Lehrveranstaltungen') ?></header>
                <?= _('Verknüpfen Sie diese Studiengruppen mit Lehrveranstaltungen, mit deren Inhalten sich diese Studiengruppe beschäftigt. Dadurch machen Sie diese Studiengruppe sichtbarer für andere Teilnehmende der Veranstaltung.') ?>
            </div>

            <?= \Studip\LinkButton::create(
                _('Verknüpfung zu Lehrveranstaltung vorschlagen'),
                $controller->connect(),
                ['data-dialog' => 1]
             )?>
        </div>
    </div>

<? endif ?>