Skip to content
Snippets Groups Projects
Commit 0f1aa02c authored by Moritz Strohm's avatar Moritz Strohm Committed by David Siegfried
Browse files

TIC 1311, closes #1311

Closes #1311

Merge request studip/studip!807
parent 05cf41b8
No related branches found
No related tags found
No related merge requests found
......@@ -67,6 +67,7 @@ class Resources_ExportController extends AuthenticatedController
PageLayout::setTitle(_('Quellen für den Export von Buchungen auswählen'));
$this->weekdays = ['1', '2', '3', '4', '5'];
$this->select_rooms = Request::get('select_rooms');
if ($this->select_rooms) {
......@@ -265,12 +266,21 @@ class Resources_ExportController extends AuthenticatedController
'H:i'
);
//Get the selected weekdays:
$this->weekdays = Request::getArray('weekdays');
if ($this->begin >= $this->end) {
PageLayout::postError(
_('Der Startzeitpunkt darf nicht hinter dem Endzeitpunkt liegen!')
);
return;
}
if (!$this->weekdays) {
PageLayout::postError(
_('Bitte mindestens einen Wochentag auswählen.')
);
return;
}
//Resolve the IDs to clipboards (or rooms) and build a list of rooms.
......@@ -342,6 +352,13 @@ class Resources_ExportController extends AuthenticatedController
//Prepare data for export:
foreach ($intervals as $interval) {
//Check the weekday of the interval first to avoid any other computation
//if the weekday is not one of the selected weekdays.
$interval_weekday = date('N', $interval->begin);
if (!in_array($interval_weekday, $this->weekdays)) {
//The interval is not on one of the selected weekdays.
continue;
}
$booking = $interval->booking;
if (!$booking instanceof ResourceBooking || !in_array($booking->booking_type, $types)) {
continue;
......
......@@ -46,6 +46,14 @@ class RoomManagement_PlanningController extends AuthenticatedController
//Build sidebar:
$sidebar = Sidebar::get();
$actions = new ActionsWidget();
$actions->addLink(
_('Drucken'),
'javascript:void(window.print());',
Icon::create('print')
);
$sidebar->addWidget($actions);
$views = new ViewsWidget();
if ($GLOBALS['user']->id && ($GLOBALS['user']->id !== 'nobody')) {
$views->addLink(
......@@ -291,6 +299,11 @@ class RoomManagement_PlanningController extends AuthenticatedController
}
$actions = new ActionsWidget();
$actions->addLink(
_('Drucken'),
'javascript:void(window.print());',
Icon::create('print')
);
$actions->addLink(
_('Buchungen kopieren'),
$this->url_for('room_management/planning/copy_bookings'),
......
......@@ -19,6 +19,46 @@
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>
<? if ($available_rooms): ?>
<table class="default">
<caption>
......
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