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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
|
<? if (!Request::isXhr()) : ?>
<h1><?= _('Neuen Blocktermin anlegen') ?></h1>
<? endif ?>
<form <?= Request::isXhr() ? 'data-dialog="size=big"' : '' ?>
class="default collapsable"
action="<?= $controller->link_for('course/block_appointments/save/' . $course_id) ?>"
method="post">
<? if ($confirm_many): ?>
<?= MessageBox::info(sprintf(
_('Sie legen %s%u%s Termine an. Bitte kontrollieren Sie Ihre Eingaben '
. 'oder bestätigen Sie, dass die Termine angelegt werden sollen.'),
'<strong>',
$confirm_many,
'</strong>'
), [
sprintf(
'<label><input type="checkbox" name="confirmed" value="1">%s</label>',
studip_interpolate(_('Ja, ich möchte wirklich %{ n } Termine erstellen.'), ['n' => $confirm_many])
),
]) ?>
<? endif; ?>
<fieldset>
<legend><?= _('Zeitraum') ?></legend>
<label for="block_appointments_start_day" class="col-3">
<?= _('Startdatum') ?>
<input type="text" class="size-s has-date-picker" data-date-picker id="block_appointments_start_day"
name="block_appointments_start_day" value="<?= $request['block_appointments_start_day'] ?? '' ?>">
</label>
<label for="block_appointments_end_day" class="col-3">
<?= _('Enddatum') ?>
<input type="text" class="size-s has-date-picker" data-date-picker='{">=":"#block_appointments_start_day"}' id="block_appointments_end_day"
name="block_appointments_end_day" value="<?= $request['block_appointments_end_day'] ?? '' ?>">
</label>
<label for="block_appointments_start_time" class="col-3">
<?= _('Startzeit') ?>
<input type="text" class="size-s studip-timepicker" id="block_appointments_start_time"
name="block_appointments_start_time" value="<?= $request['block_appointments_start_time'] ?? '' ?>"
placeholder="HH:mm">
</label>
<label for="block_appointments_end_time" class="col-3">
<?= _('Endzeit') ?>
<input type="text" class="size-s studip-timepicker" id="block_appointments_end_time"
name="block_appointments_end_time" value="<?= $request['block_appointments_end_time'] ?? '' ?>"
placeholder="HH:mm">
</label>
<div id="block_appointments_days">
<label><?= _('Die Veranstaltung findet an folgenden Tagen statt') ?></label>
<label for="block_appointments_days_0" class="col-2">
<input <?= empty($request['block_appointments_days']) || in_array('everyday', $request['block_appointments_days']) ? 'checked' : '' ?>
class="block_appointments_days"
name="block_appointments_days[]" id="block_appointments_days_0" type="checkbox" value="everyday">
<?= _('Jeden Tag') ?>
</label>
<label for="block_appointments_days_1" class="col-2">
<input <?= in_array('weekdays', (array) ($request['block_appointments_days'] ?? [])) ? 'checked ' : '' ?>
class="block_appointments_days"
name="block_appointments_days[]" id="block_appointments_days_1" type="checkbox" value="weekdays">
<?= _('Mo-Fr') ?>
</label>
<? foreach (range(0, 6) as $d) : ?>
<? $id = 2 + $d ?>
<label for="block_appointments_days_<?= $id ?>" class="col-2">
<input <?= in_array($d + 1, (array) ($request['block_appointments_days'] ?? [])) ? 'checked ' : '' ?>
class="block_appointments_days"
name="block_appointments_days[]" id="block_appointments_days_<?= $id ?>" type="checkbox"
value="<?= $d + 1 ?>">
<?= strftime('%A', strtotime("+$d day", $start_ts)) ?>
</label>
<? endforeach ?>
</div>
</fieldset>
<fieldset class="collapsed">
<legend><?= _('Weitere Daten') ?></legend>
<label for="block_appointments_termin_typ">
<?= _('Art der Termine') ?>
<select clas="size-l" name="block_appointments_termin_typ" id="block_appointments_termin_typ">
<? foreach ($GLOBALS['TERMIN_TYP'] as $key => $value) : ?>
<option
value="<?= $key ?>" <?= ($request['block_appointments_termin_typ'] ?? '') == $key ? 'selected' : '' ?>>
<?= htmlReady($value['name']) ?>
</option>
<? endforeach ?>
</select>
</label>
<? if (Config::get()->RESOURCES_ENABLE && ($selectable_rooms || $room_search)) : ?>
<label>
<?= _('Raum') ?>
<? if ($room_search): ?>
<?= $room_search->render() ?>
<? else: ?>
<select name="room_id" style="width: calc(100% - 23px);">
<option value=""><?= _('<em>Keinen</em> Raum buchen') ?></option>
<? foreach ($selectable_rooms as $room): ?>
<option value="<?= htmlReady($room->id) ?>">
<?= htmlReady($room->name) ?>
<? if ($room->seats > 1) : ?>
<?= sprintf(_('(%d Sitzplätze)'), $room->seats) ?>
<? endif ?>
</option>
<? endforeach ?>
</select>
<? endif ?>
</label>
<? endif ?>
<label for="block_appointments_room_text">
<?= _('Freie Ortsangabe') ?>
<input type="text" name="block_appointments_room_text" id="block_appointments_room_text"
value="<?= htmlReady($request['block_appointments_room_text'] ?? '') ?>">
</label>
<? if (count($lecturers)): ?>
<label for="lecturers[]">
<?= _('Durchführende Lehrende') ?>
<? if (count($lecturers) > 1): ?>
<select name="lecturers[]" multiple="multiple" class="multiple">
<? foreach ($lecturers as $lecturer): ?>
<option value="<?= $lecturer->user_id ?>"
<? if (in_array($lecturer->user_id, Request::optionArray('lecturers'))) echo 'selected'; ?>>
<?= htmlReady($lecturer->user->getFullName()) ?>
</option>
<? endforeach ?>
</select>
<? else: ?>
<p style="margin-left: 15px">
<? $lecturer = array_pop($lecturers) ?>
<?= htmlReady($lecturer->user->getFullName()) ?>
</p>
<? endif; ?>
</label>
<? endif ?>
<label for="block_appointments_date_count">
<?= _('Anzahl der Termine') ?>
<input type="text" name="block_appointments_date_count" id="block_appointments_date_count" class="size-s" value="<?= $request['block_appointments_date_count'] ?? 1 ?>">
</label>
</fieldset>
<footer data-dialog-button>
<?= Studip\Button::createAccept(_('Speichern'), 'save') ?>
<?= Studip\LinkButton::create(_('Zurück zur Übersicht'), $controller->url_for('course/timesrooms/index'), ['data-dialog' => 'size=big']) ?>
</footer>
</form>
|