aboutsummaryrefslogtreecommitdiff
path: root/app/views/course/connectedstudygroups/index.php
blob: 4611b6cbe28f2dcd3d16f4b1449644f394a81ada (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
<? if (count($connected) + count($proposals) > 0) : ?>
    <? if (count($connected) > 0) : ?>
        <form method="post">
            <table class="default">
                <caption>
                    <?= _('Verknüpfte Studiengruppen') ?>
                    <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/studygroup/details/' . $connection['studygroup_id'], [], true) ?>">
                                    <?= StudygroupAvatar::getAvatar($connection['studygroup_id'])->getImageTag(Avatar::SMALL) ?>
                                    <?= htmlReady($connection->studygroup->getFullName()) ?>
                                </a>
                            </td>
                            <td class="actions">
                                <?= CSRFProtection::tokenTag() ?>
                                <?= Icon::create('trash')->asInput([
                                    'title'        => _('Verknüpfung aufheben'),
                                    'data-confirm' => _('Wirklich die Zuweisung zu der Studiengruppe aufheben?'),
                                    'formaction'   => $controller->removeURL($connection['studygroup_id'])
                                ]) ?>
                            </td>
                        </tr>
                        <? endforeach ?>
                    </tbody>
                </caption>
            </table>
        </form>
    <? endif ?>

    <? if (count($proposals) > 0) : ?>
        <form method="post">
            <table class="default">
                <?= CSRFProtection::tokenTag() ?>
                <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/studygroup/details/' . $proposal['studygroup_id']) ?>" target="_blank">
                                <?= StudygroupAvatar::getAvatar($proposal['studygroup_id'])->getImageTag(Avatar::SMALL) ?>
                                <?= htmlReady($proposal->studygroup->getFullName()) ?>
                            </a>
                        </td>
                        <td>
                            <?= htmlReady($proposal->user->getFullName()) ?>
                        </td>
                        <td class="actions">
                            <? if ($proposal['proposed_from'] === 'studygroup') : ?>
                                <?= Icon::create('accept')->asInput([
                                    'title'        => _('Vorschlag annehmen'),
                                    'data-confirm' => _('Wirklich die Studiengruppe mit dieser Veranstaltung verknüpfen?'),
                                    'formaction'   => $controller->connectURL($proposal['studygroup_id'])
                                ]) ?>
                            <? endif ?>
                            <? if ($proposal['proposed_from'] === 'studycourse') : ?>
                                <?= 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 Studiengruppen') ?></header>
                <?= _('Verknüpfen Sie Studiengruppen, die sich mit den Inhalten dieser Veranstaltung beschäftigen.') ?>
            </div>

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

<? endif ?>