summaryrefslogtreecommitdiff
path: root/includes/view
diff options
context:
space:
mode:
authorIgor Scheller <igor.scheller@igorshp.de>2017-08-30 14:59:27 +0200
committerIgor Scheller <igor.scheller@igorshp.de>2017-08-30 15:35:12 +0200
commit96f1d9fd541d0c5ef78151f8c69a89c41684b67a (patch)
treee39f5afde165a55f49857d064675fa1876a66808 /includes/view
parenta473a56f1dbf568dc66cd6fcffe6b638308c542e (diff)
Bugfixes
Diffstat (limited to 'includes/view')
-rw-r--r--includes/view/Rooms_view.php2
-rw-r--r--includes/view/ShiftCalendarShiftRenderer.php14
-rw-r--r--includes/view/ShiftsFilterRenderer.php11
3 files changed, 18 insertions, 9 deletions
diff --git a/includes/view/Rooms_view.php b/includes/view/Rooms_view.php
index 76ce33a5..3c0440a4 100644
--- a/includes/view/Rooms_view.php
+++ b/includes/view/Rooms_view.php
@@ -12,7 +12,7 @@ use Engelsystem\ShiftsFilterRenderer;
function Room_view($room, ShiftsFilterRenderer $shiftsFilterRenderer, ShiftCalendarRenderer $shiftCalendarRenderer)
{
return page_with_title(glyph('map-marker') . $room['Name'], [
- $shiftsFilterRenderer->render(room_link($room)),
+ $shiftsFilterRenderer->render($room),
$shiftCalendarRenderer->render()
]);
}
diff --git a/includes/view/ShiftCalendarShiftRenderer.php b/includes/view/ShiftCalendarShiftRenderer.php
index f0488e83..0e5fc8c3 100644
--- a/includes/view/ShiftCalendarShiftRenderer.php
+++ b/includes/view/ShiftCalendarShiftRenderer.php
@@ -124,11 +124,15 @@ class ShiftCalendarShiftRenderer
}
if (in_array('user_shifts_admin', $privileges)) {
- $html .= '<li class="list-group-item">' . button(
- page_link_to('user_shifts', ['shift_id' => $shift['SID']]),
- _('Add more angels'),
- 'btn-xs'
- ) . '</li>';
+ $html .= '<li class="list-group-item">' . _('Add more angels') . ':';
+ foreach ($needed_angeltypes as $angeltype) {
+ $html .= ' ' . button(
+ page_link_to('user_shifts', ['shift_id' => $shift['SID'], 'type_id' => $angeltype['id']]),
+ $angeltype['name'],
+ 'btn-xs'
+ );
+ }
+ $html .= '</li>';
}
if ($html != '') {
return [
diff --git a/includes/view/ShiftsFilterRenderer.php b/includes/view/ShiftsFilterRenderer.php
index 43a23ef6..c3e0ccf1 100644
--- a/includes/view/ShiftsFilterRenderer.php
+++ b/includes/view/ShiftsFilterRenderer.php
@@ -39,17 +39,22 @@ class ShiftsFilterRenderer
/**
* Renders the filter.
*
- * @param string $link_base
+ * @param array $room
* @return string Generated HTML
*/
- public function render($link_base)
+ public function render($room)
{
$toolbar = [];
if ($this->daySelectionEnabled && !empty($this->days)) {
$selected_day = date('Y-m-d', $this->shiftsFilter->getStartTime());
$day_dropdown_items = [];
foreach ($this->days as $day) {
- $day_dropdown_items[] = toolbar_item_link($link_base . '&shifts_filter_day=' . $day, '', $day);
+ $link = page_link_to('rooms', [
+ 'action' => 'view',
+ 'room_id' => $room['RID'],
+ 'shifts_filter_day' => $day,
+ ]);
+ $day_dropdown_items[] = toolbar_item_link($link, '', $day);
}
$toolbar[] = toolbar_dropdown('', $selected_day, $day_dropdown_items, 'active');
}