aboutsummaryrefslogtreecommitdiff
path: root/app/views/resources/room_request/_add_edit_form.php
blob: c256e02c91f434bb1a9862a99de5b3e002c58142 (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
<?php
/**
 * @var bool $show_form
 * @var string $form_action_link
 * @var string $origin_url
 * @var string $begin_date_str
 * @var string $end_date_str
 * @var string $begin_time_str
 * @var string $end_time_str
 * @var int $preparation_time
 * @var int $max_preparation_time
 * @var int $subsequent_time
 * @var string $comment
 * @var string $booking_text
 * @var ResourceRequest $request
 * @var Resources_RoomRequestController $controller
 */
?>
<? if ($show_form): ?>
    <form class="default" method="post" action="<?= $form_action_link ?>" data-dialog="reload-on-close">
        <input type="hidden" name="origin_url" value="<?= htmlReady($origin_url ?? '') ?>">
        <label>
            <input type="checkbox" <?= ($begin_date_str != $end_date_str) ? 'checked' : ''; ?>
                   onClick="$('#end_date_section').toggle();">
            <?= _('Mehrtägig') ?>
        </label>
        <section>
            <label class="col-2" style="min-width: 40%">
                <?= _('Startdatum') ?>
                <input type="text" name="begin_date" class="has-date-picker size-s"
                       value="<?= htmlReady($begin_date_str) ?>">
            </label>
            <label id="end_date_section"
                   style="min-width: 40%;<?= ($begin_date_str == $end_date_str) ? 'display: none;' : ''; ?>"
                   class="col-2">
                <?= _('Enddatum') ?>
                <input type="text" name="end_date" class="has-date-picker size-s"
                       value="<?= htmlReady($end_date_str) ?>">
            </label>
        </section>
        <section>
            <label class="col-2">
                <?= _('Startuhrzeit') ?>
                <input type="text" name="begin_time" class="has-time-picker size-s"
                       value="<?= htmlReady($begin_time_str) ?>">
            </label>
            <label class="col-2">
                <?= _('Enduhrzeit') ?>
                <input type="text" name="end_time" class="has-time-picker size-s"
                       value="<?= htmlReady($end_time_str) ?>">
            </label>
        </section>
        <label>
            <?= _('Rüstzeit vor der Buchung (in Minuten)') ?>
            <input type="number" name="preparation_time" value="<?= htmlReady($preparation_time) ?>" min="0"
                   max="<?= htmlReady($max_preparation_time) ?>" class="size-s">
        </label>
        <label>
            <?= _('Rüstzeit nach der Buchung (in Minuten)') ?>
            <input type="number" name="subsequent_time" value="<?= htmlReady($subsequent_time) ?>" min="0"
                   max="<?= htmlReady($max_preparation_time) ?>" class="size-s">
        </label>
        <label>
            <?= _('Interner Kommentar') ?>
            <textarea name="comment"><?= htmlReady($comment) ?></textarea>
        </label>
        <label>
            <?= _('Buchungstext') ?>
            <textarea name="booking_text"><?= htmlReady($booking_text) ?></textarea>
        </label>
        <footer data-dialog-button>
            <?= \Studip\Button::create(_('Speichern'), 'save') ?>
            <? if ($request): ?>
                <?= \Studip\LinkButton::create(
                    _('Löschen'),
                    $controller->url_for('resources/room_request/delete/' . $request->id),
                    ['data-dialog' => '1']
                ) ?>
            <? endif ?>
        </footer>
    </form>
<? endif ?>