aboutsummaryrefslogtreecommitdiff
path: root/app/views/resources/admin/global_locks.php
blob: 6f446305323eab15a199a9f9c5e2e637b99cb574 (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
<? if ($locks): ?>
    <table class="default">
        <thead>
            <tr>
                <th><?= _('Beginn') ?></th>
                <th><?= _('Ende') ?></th>
                <th><?= _('Typ der Sperrung') ?></th>
                <th class="actions"><?= _('Aktionen') ?></th>
            </tr>
        </thead>
        <tbody>
            <? foreach ($locks as $lock): ?>
                <tr>
                    <td><?= date('d.m.Y H:i', $lock->begin) ?></td>
                    <td><?= date('d.m.Y H:i', $lock->end) ?></td>
                    <td><?= htmlReady($lock->getTypeString()) ?></td>
                    <td class="actions">
                        <?= ActionMenu::get()->setContext(
                            sprintf(
                                _('Sperre vom %1$s, %2$s Uhr bis %3$s, %4$s Uhr'),
                                strftime('%x', $lock->begin),
                                date('H:i', $lock->begin),
                                strftime('%x', $lock->end),
                                date('H:i', $lock->end)
                            )
                        )->addLink(
                                $controller->url_for('resources/global_locks/edit/' . $lock->id),
                                _('Sperrung bearbeiten'),
                                Icon::create('edit'),
                                [
                                    'data-dialog' => 'size=auto'
                                ])
                            ->addLink(
                                $controller->url_for('resources/global_locks/delete/' . $lock->id),
                                _('Sperrung löschen'),
                                Icon::create('trash'),
                                [
                                    'data-dialog' => 'size=auto'
                                ]
                            )
                            ->render();
                        ?>
                    </td>
                </tr>
            <? endforeach ?>
        </tbody>
    </table>
<? else: ?>
    <?= MessageBox::info(
        _('Es sind keine gegenwärtigen und zukünftigen Sperren der Raumverwaltung hinterlegt.')
    ) ?>
<? endif ?>