aboutsummaryrefslogtreecommitdiff
path: root/app/views/calendar/schedule/entry.php
blob: 61090413a8a174a3a2860b8084778f6cdfc8ac0c (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
<?php
/**
 * @var AuthenticatedController $controller
 * @var ScheduleEntry $entry The schedule entry to be created/modified.
 */
?>
<form class="default schedule-entry" method="post"
      action="<?= $controller->link_for('calendar/schedule/entry/' . ($entry->isNew() ? 'add' : $entry->id)) ?>"
      data-dialog="reload-on-close">
    <?= CSRFProtection::tokenTag() ?>
    <fieldset>
        <legend><?= _('Farbe') ?></legend>
        <table class="colour-selector">
            <tr>
                <?= $this->render_partial(
                    'calendar/schedule/_colour_selector',
                    ['selected_colour_id' => $entry->colour_id]
                ) ?>
            </tr>
        </table>
    </fieldset>
    <fieldset>
        <legend><?= _('Zeit') ?></legend>
        <section class="hgroup nowrap">
            <label>
                <?= _('Wochentag') ?>
                <select name="dow" class="size-s">
                    <option value="1" <?= $entry->dow === 1 ? 'selected' : '' ?>>
                        <?= _('Montag') ?>
                    </option>
                    <option value="2" <?= $entry->dow === 2 ? 'selected' : '' ?>>
                        <?= _('Dienstag') ?>
                    </option>
                    <option value="3" <?= $entry->dow === 3 ? 'selected' : '' ?>>
                        <?= _('Mittwoch') ?>
                    </option>
                    <option value="4" <?= $entry->dow === 4 ? 'selected' : '' ?>>
                        <?= _('Donnerstag') ?>
                    </option>
                    <option value="5" <?= $entry->dow === 5 ? 'selected' : '' ?>>
                        <?= _('Freitag') ?>
                    </option>
                    <option value="6" <?= $entry->dow === 6 ? 'selected' : '' ?>>
                        <?= _('Samstag') ?>
                    </option>
                    <option value="7" <?= $entry->dow === 7 ? 'selected' : '' ?>>
                        <?= _('Sonntag') ?>
                    </option>
                </select>
            </label>
            <label>
                <?= _('Anfang') ?>
                <input type="text" class="has-time-picker size-s" name="start"
                       value="<?= htmlReady($entry->getFormattedStart()) ?>">
            </label>
            <label>
                <?= _('Ende') ?>
                <input type="text" class="has-time-picker size-s" name="end"
                       value="<?= htmlReady($entry->getFormattedEnd()) ?>">
            </label>
        </section>
    </fieldset>
    <fieldset>
        <legend><?= _('Inhalt') ?></legend>
        <label>
            <?= _('Titel') ?>
            <input type="text" name="label" value="<?= htmlReady($entry->label) ?>">
        </label>
        <label>
            <?= _('Beschreibung') ?>
            <textarea name="content"><?= htmlReady($entry->content) ?></textarea>
        </label>
    </fieldset>
    <div data-dialog-button>
        <?= \Studip\Button::createAccept(
            _('Speichern'),
            'save',
            ['formaction' => $controller->url_for('calendar/schedule/save_entry/' . ($entry->isNew() ? 'add' : $entry->id))]
        ) ?>
        <? if (!$entry->isNew()) : ?>
            <?= \Studip\Button::create(
                _('Löschen'),
                'delete',
                ['formaction' => $controller->url_for('calendar/schedule/delete_entry/' . $entry->id)]
            ) ?>
        <? endif ?>
        <?= \Studip\Button::createCancel(_('Abbrechen')) ?>
    </div>
</form>