aboutsummaryrefslogtreecommitdiff
path: root/app/views/admin/holidays/index.php
blob: 98aa72e34f9a9c266e840f00906db161726ad2a0 (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
<?php
/**
 * @var Admin_HolidaysController $controller
 * @var SemesterHoliday[] $holidays
 * @var string $filter
 */
?>
<form action="<?= $controller->url_for('admin/holidays/delete/bulk') ?>" method="post">
    <?= CSRFProtection::tokenTag() ?>

<table class="default" id="holidays">
    <caption><?= _('Ferien') ?></caption>
    <colgroup>
        <col width="20px">
        <col>
        <col width="50%">
        <col width="48px">
    </colgroup>
    <thead>
        <tr>
            <th>
                <input type="checkbox"
                       data-proxyfor="#holidays tbody :checkbox"
                       data-activates="#holidays tfoot button">
            </th>
            <th><?= _('Name') ?></th>
            <th><?= _('Zeitraum') ?></th>
            <th>&nbsp;</th>
        </tr>
    </thead>
    <tbody>
<? if (empty($holidays)): ?>
        <tr>
            <td colspan="4" style="text-align: center;">
            <? if ($filter): ?>
                <?= _('In der gewählten Ansicht gibt es keine Einträge.') ?>
            <? else: ?>
                <?= _('Es wurden noch keine Ferien angelegt.') ?><br>
                <?= Studip\LinkButton::create(_('Neue Ferien anlegen'),
                                              $controller->url_for('admin/holidays/edit'),
                                              ['data-dialog' => 'size=auto']) ?>
            <? endif; ?>
            </td>
        </tr>
<? else: ?>
    <? foreach ($holidays as $holiday): ?>
        <tr <? if ($holiday->current) echo 'style="font-weight: bold;"'; ?>>
            <td>
                <input type="checkbox" name="ids[]" value="<?= $holiday->id ?>">
            </td>
            <td title="<?= htmlReady($holiday->description) ?>">
                <?= htmlReady($holiday->name) ?>
            </td>
            <td>
                <?= strftime('%x', $holiday->beginn) ?>
                -
                <?= strftime('%x', $holiday->ende) ?>
            </td>
            <td class="actions">
                <a data-dialog="size=auto" href="<?= $controller->url_for('admin/holidays/edit/' . $holiday->id) ?>">
                    <?= Icon::create('edit')->asImg(['title' => _('Ferienangaben bearbeiten')]) ?>
                </a>
                <?= Icon::create('trash')->asInput([
                    'title' => _('Ferien löschen'),
                    'formaction'   => $controller->url_for('admin/holidays/delete/' . $holiday->id),
                    'data-confirm' => _('Sollen die Ferien wirklich gelöscht werden?'),
                    'class' => 'text-bottom',
                ]) ?>
            </td>
        </tr>
    <? endforeach; ?>
<? endif; ?>
    </tbody>
    <tfoot>
        <tr>
            <td colspan="4">
                <?= _('Markierte Einträge') ?>
                <?= Studip\Button::create(_('Löschen'), 'delete', [
                    'data-confirm' => _('Sollen die Ferien wirklich gelöscht werden?'),
                ]) ?>
            </td>
        </tr>
    </tfoot>
</table>
</form>