aboutsummaryrefslogtreecommitdiff
path: root/app/views/studiengaenge/fachbereichestgteile/index.php
blob: fc60e5f575499679d638bc7fedd776a68c6a9b41 (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
<?php
/**
 * @var Studiengaenge_FachbereichestgteileController $controller
 * @var StudiengangTeil[] $fachbereiche
 * @var array $stgteil_ids
 * @var string $details_id
 */
?>
<form method="post">
    <?= CSRFProtection::tokenTag() ?>
    <table class="default collapsable">
        <thead>
            <tr class="sortable">
                <?= $controller->renderSortLink('studiengaenge/fachbereichestgteile/', _('Fachbereich'), 'fachbereich') ?>
                <th style="width: 5%; text-align: right;"><?= _('Aktionen') ?></th>
            </tr>
        </thead>
        <? foreach ($fachbereiche as $fachbereich) : ?>
            <tbody class="<?= $fachbereich['stgteile'] ? '' : 'empty' ?> <?= ((count($stgteil_ids) || $details_id === $fachbereich['institut_id']) ? 'not-collapsed' : 'collapsed') ?>">
                <tr class="header-row">
                    <td class="toggle-indicator">
                        <? if ($fachbereich['stgteile']) : ?>
                            <a class="mvv-load-in-new-row"
                               href="<?= $controller->action_link('details_fachbereich/' . $fachbereich['institut_id']) ?>">
                                <?= htmlReady($fachbereich['name']) ?>
                            </a>
                        <? else: ?>
                            <?= htmlReady($fachbereich['name']) ?>
                        <? endif; ?>
                    </td>
                    <td class="actions dont-hide" style="white-space: nowrap;">
                        <? if (MvvPerm::havePermCreate('StudiengangTeil')) : ?>
                            <a href="<?= $controller->action_link('stgteil_fachbereich/' . $fachbereich['institut_id']) ?>">
                                <?= Icon::create('file', Icon::ROLE_CLICKABLE , ['title' => _('Neuen Studiengangteil in diesem Fachbereich anlegen')])->asSvg(); ?>
                            </a>
                        <? endif; ?>
                    </td>
                </tr>
            <? if (isset($details_id) && $details_id === $fachbereich['institut_id'] || count($stgteil_ids)) : ?>
                <? $stgteile = StudiengangTeil::findByFachbereich($fachbereich['institut_id'], ['mvv_stgteil.stgteil_id' => $stgteil_ids], 'fach_name,zusatz,kp', 'ASC'); ?>
                <tr class="loaded-details nohover">
                    <?= $this->render_partial('studiengaenge/studiengangteile/details_grouped', compact('stgteile')) ?>
                </tr>
            <? endif; ?>
            </tbody>
        <? endforeach ?>
    </table>
</form>