aboutsummaryrefslogtreecommitdiff
path: root/app/views/my_institutes/index.php
blob: ad24a711b03501f6f039d9068e5f2201b28930dc (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
<? if (isset($flash['decline_inst'])) : ?>
    <?= QuestionBox::create(
        sprintf(
            _('Wollen Sie sich aus dem/der %s wirklich austragen?'),
            htmlReady($flash['name'])
        ),
        $controller->decline_instURL($flash['inst_id'], ['cmd' => 'kill', 'studipticket' => $flash['studipticket']]),
        $controller->decline_instURL($flash['inst_id'], ['cmd'=> 'back', 'studipticket' => $flash['studipticket']])
    ) ?>
<? endif ?>

<? if (empty($institutes)) : ?>
    <? if (!Config::get()->ALLOW_SELFASSIGN_INSTITUTE || $GLOBALS['perm']->have_perm("dozent")) : ?>
        <?=
        MessageBox::info(sprintf(_('Sie wurden noch keinen Einrichtungen zugeordnet. Bitte wenden Sie sich an einen der zuständigen %sAdministratoren%s.'),
            '<a href="' . URLHelper::getLink('dispatch.php/siteinfo/show') . '">', '</a>'))?>
    <? else : ?>
        <?=
        MessageBox::info(sprintf(_('Sie haben sich noch keinen Einrichtungen zugeordnet.
           Um sich Einrichtungen zuzuordnen, nutzen Sie bitte die entsprechende %sOption%s unter "Persönliche Angaben - Studiendaten"
           auf Ihrer persönlichen Einstellungsseite.'), '<a href="' . URLHelper::getLink('dispatch.php/settings/studies#einrichtungen') . '">', '</a>'))?>
    <? endif ?>
<? else : ?>
    <table class="default" id="my_institutes">
        <caption><?= _('Meine Einrichtungen') ?></caption>
        <colgroup>
            <col style="width: 25px">
            <col>
            <col style="width: <?= $nav_elements * 32 ?>px">
            <col style="width: 45px">
        </colgroup>
        <thead>
        <tr>
            <th></th>
            <th><?= _('Name') ?></th>
            <th><?= _('Inhalt') ?></th>
            <th></th>
        </tr>
        </thead>
        <tbody>
        <? foreach ($institutes as $values) : ?>
            <? $lastVisit = $values['visitdate']; ?>
            <? $instid = $values['institut_id'] ?>
            <tr>
                <td>
                    <?= InstituteAvatar::getAvatar($instid)->getImageTag(Avatar::SMALL, ['title' => $values['name']]) ?>
                </td>

                <td style="text-align: left">
                    <a href="<?= URLHelper::getLink('dispatch.php/institute/overview', ['auswahl' => $instid]) ?>">
                        <?= htmlReady($GLOBALS['INST_TYPE'][$values['type']]['name'] . ': ' . $values['name']) ?>
                    </a>
                </td>

                <td style="text-align: left; white-space: nowrap">
                <? if (!empty($values['navigation'])) : ?>
                    <ul class="my-courses-navigation">
                    <? foreach (MyRealmModel::array_rtrim($values['navigation']) as $key => $nav)  : ?>
                        <? if (isset($nav) && $nav->isVisible(true)) : ?>
                            <li class="my-courses-navigation-item <? if ($nav->getImage()->signalsAttention()) echo 'my-courses-navigation-important'; ?>">
                                <a href="<?=
                                URLHelper::getLink('dispatch.php/institute/overview',
                                    ['auswahl'     => $instid,
                                          'redirect_to' => $nav->getURL()]) ?>" <?= $nav->hasBadgeNumber() ? 'class="badge" data-badge-number="' . intval($nav->getBadgeNumber()) . '"' : '' ?>>
                                    <?= $nav->getImage()->asImg($nav->getLinkAttributes()) ?>
                                </a>
                            </li>
                        <? else: ?>
                            <li class="my-courses-navigation-item">
                                <span class="empty-slot" style="width: 20px"></span>
                            </li>
                        <? endif ?>
                    <? endforeach ?>
                    </ul>
                <? endif ?>
                </td>

                <td style="text-align: left; white-space: nowrap">
                <? if (Config::get()->ALLOW_SELFASSIGN_INSTITUTE && $values['perms'] === 'user') : ?>
                    <a href="<?= $controller->decline_inst($instid) ?>">
                        <?= Icon::create('door-leave')->asImg(['title' => _('Aus der Einrichtung austragen')]) ?>
                    </a>
                <? else : ?>
                    <?= Assets::img('blank.gif', ['size' => Icon::SIZE_DEFAULT]) ?>
                <? endif ?>
                </td>
            </tr>
        <? endforeach ?>
        </tbody>
    </table>
<? endif ?>