aboutsummaryrefslogtreecommitdiff
path: root/app/views/resources/room/index.php
blob: 4c0fb23322738986dc9ea3076d2b8aea6031e8b3 (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
<nav class="resource-hierarchy">
    <? if ($room->building->location): ?>
        <a href="<?= $room->building->location->getActionLink('show') ?>" <?= (Request::isDialog()) ? 'data-dialog' : ''; ?>>
            <?= htmlReady($room->building->location->name) ?>
        </a>
        &gt;
    <? endif ?>
    <? if ($room->building): ?>
        <a href="<?= $room->building->getActionLink('show') ?>" <?= (Request::isDialog()) ? 'data-dialog' : ''; ?>>
            <?= htmlReady($room->building->name) ?>
        </a>
        &gt;
    <? endif ?>
    <?= htmlReady($room->name) ?>
</nav>

<section class="contentbox">
    <header>
        <h1><?= _('Beschreibung und Hinweise') ?></h1>
    </header>
    <section>
        <? if ((string)$room->description !== ''): ?>
            <p><?= htmlReady($room->description) ?></p>
        <? endif ?>
        <ul>
            <? if ($room->room_type): ?>
                <li><?= htmlReady($room->room_type) ?></li>
            <? endif ?>
            <li>
                <?= sprintf(
                    ngettext('%d Sitzplatz', '%d Sitzplätze', intval($room->seats)), intval($room->seats)
                ) ?>
            </li>
        </ul>
    </section>
</section>

<? if ($grouped_properties): ?>
    <?= $this->render_partial(
        'resources/resource/_standard_properties_display_part.php',
        [
            'property_groups' => $grouped_properties
        ]
    ) ?>
<? endif ?>

<? $resource_folder = $room->getFolder(); ?>
<? if ($resource_folder && $resource_folder->getFiles()): ?>
    <section class="contentbox">
        <header>
            <h1><?= _('Dateien') ?></h1>
        </header>
        <table class="default sortable-table" data-sortlist="[[1, 0]]">
            <?= $this->render_partial('files/_files_thead') ?>
            <? foreach ($resource_folder->getFiles() as $file): ?>
                <? if ($file->isVisible($GLOBALS['user']->id)) : ?>
                    <?= $this->render_partial(
                        'files/_fileref_tr',
                        [
                            'file' => $file,
                            'current_folder' => $resource_folder,
                            'last_visitdate' => time()
                        ]
                    ) ?>
                <? endif ?>
            <? endforeach ?>
        </table>
    </section>
<? endif ?>

<footer data-dialog-button>
    <? if ($current_user_is_resource_autor) : ?>
        <?= \Studip\LinkButton::create(
            _('Wochenbelegung'),
            $room->getActionURL('booking_plan')
        ) ?>
        <?= \Studip\LinkButton::create(
            _('Semesterbelegung'),
            $room->getActionURL('semester_plan')
        ) ?>
    <? elseif ($booking_plan_is_visible) : ?>
        <?= \Studip\LinkButton::create(
            _('Belegungsplan'),
            $room->getActionURL('booking_plan')
        ) ?>
        <?= \Studip\LinkButton::create(
            _('Semesterbelegung'),
            $room->getActionURL('semester_plan')
        ) ?>
    <? endif ?>

    <? if ($geo_coordinates_object instanceof ResourceProperty): ?>
        <?= \Studip\LinkButton::create(
            _('Zum Lageplan'),
            ResourceManager::getMapUrlForResourcePosition(
                $geo_coordinates_object
            )
        ) ?>
    <? endif ?>
    <? if ($current_user_is_resource_admin) : ?>
        <?= \Studip\LinkButton::createEdit(
            _('Bearbeiten'),
            $room->getActionURL('edit'),
            [
                'data-dialog' => 'size=auto'
            ]
        ) ?>
    <? endif ?>
    <? if (!$current_user_is_resource_autor && $room->requestable && $current_user_has_request_rights) : ?>
        <?= \Studip\LinkButton::create(
            _('Raum anfragen'),
            $room->getActionURL('request'),
            ['data-dialog' => 'size=auto']) ?>
    <? endif ?>
</footer>