Skip to content
Snippets Groups Projects
Commit 2933487c authored by Moritz Strohm's avatar Moritz Strohm Committed by Jan-Hendrik Willms
Browse files

added weekday selector in resources/export/resource_bookings, closes #2181

Closes #2181

Merge request studip/studip!1408
parent 970111dc
No related branches found
No related tags found
1 merge request!4Draft: Icon creation
......@@ -229,6 +229,7 @@ class Resources_ExportController extends AuthenticatedController
$this->end->setTime(23, 59, 59);
}
$this->weekdays = ['1', '2', '3', '4', '5'];
// All available booking types.
$this->booking_types = [
......
......@@ -28,6 +28,10 @@
</label>
</section>
</fieldset>
<?= $this->render_partial(
'resources/export/weekday-selector.partial.php',
compact('weekdays')
) ?>
<fieldset>
<legend><?= _('Belegungstypen auswählen') ?></legend>
<section>
......
......@@ -20,46 +20,10 @@
value="<?= $end->format('H:i')?>">
</label>
</fieldset>
<fieldset>
<legend><?= _('Wochentage auswählen') ?></legend>
<div class="hgroup">
<label>
<input type="checkbox" name="weekdays[]" value="1"
<?= in_array('1', $weekdays) ? 'checked' : '' ?>>
<?= _('Montag') ?>
</label>
<label>
<input type="checkbox" name="weekdays[]" value="2"
<?= in_array('2', $weekdays) ? 'checked' : '' ?>>
<?= _('Dienstag') ?>
</label>
<label>
<input type="checkbox" name="weekdays[]" value="3"
<?= in_array('3', $weekdays) ? 'checked' : '' ?>>
<?= _('Mittwoch') ?>
</label>
<label>
<input type="checkbox" name="weekdays[]" value="4"
<?= in_array('4', $weekdays) ? 'checked' : '' ?>>
<?= _('Donnerstag') ?>
</label>
<label>
<input type="checkbox" name="weekdays[]" value="5"
<?= in_array('5', $weekdays) ? 'checked' : '' ?>>
<?= _('Freitag') ?>
</label>
<label>
<input type="checkbox" name="weekdays[]" value="6"
<?= in_array('6', $weekdays) ? 'checked' : '' ?>>
<?= _('Samstag') ?>
</label>
<label>
<input type="checkbox" name="weekdays[]" value="7"
<?= in_array('7', $weekdays) ? 'checked' : '' ?>>
<?= _('Sonntag') ?>
</label>
</div>
</fieldset>
<?= $this->render_partial(
'resources/export/weekday-selector.partial.php',
compact('weekdays')
) ?>
<? if ($available_rooms): ?>
<table class="default">
<caption>
......
<?php
/**
* @var string[] $weekdays
*/
$days_of_the_week = [
'1' => _('Montag'),
'2' => _('Dienstag'),
'3' => _('Mittwoch'),
'4' => _('Donnerstag'),
'5' => _('Freitag'),
'6' => _('Samstag'),
'7' => _('Sonntag'),
]
?>
<fieldset>
<legend><?= _('Wochentage auswählen') ?></legend>
<div class="hgroup">
<? foreach ($days_of_the_week as $index => $label): ?>
<label>
<input type="checkbox" name="weekdays[]" value="<?= $index ?>"
<?= in_array($index, $weekdays) ? 'checked' : '' ?>>
<?= $label ?>
</label>
<? endforeach; ?>
</div>
</fieldset>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment