room view & angeltype view: show all shifts (#1067)
This commit is contained in:
parent
64be48c646
commit
89f9b423b1
|
@ -196,6 +196,9 @@ function angeltype_controller()
|
|||
|
||||
$days = angeltype_controller_shiftsFilterDays($angeltype);
|
||||
$shiftsFilter = angeltype_controller_shiftsFilter($angeltype, $days);
|
||||
if (request()->input('showFilledShifts')) {
|
||||
$shiftsFilter->setFilled([ShiftsFilter::FILLED_FREE, ShiftsFilter::FILLED_FILLED]);
|
||||
}
|
||||
|
||||
$shiftsFilterRenderer = new ShiftsFilterRenderer($shiftsFilter);
|
||||
$shiftsFilterRenderer->enableDaySelection($days);
|
||||
|
@ -204,7 +207,7 @@ function angeltype_controller()
|
|||
$request = request();
|
||||
$tab = 0;
|
||||
|
||||
if ($request->has('shifts_filter_day')) {
|
||||
if ($request->has('shifts_filter_day') || $request->has('showShiftsTab')) {
|
||||
$tab = 1;
|
||||
}
|
||||
|
||||
|
@ -266,7 +269,7 @@ function angeltype_controller_shiftsFilter(AngelType $angeltype, $days)
|
|||
if (!empty($days) && !in_array($selected_day, $days)) {
|
||||
$selected_day = $days[0];
|
||||
}
|
||||
if ($request->has('shifts_filter_day')) {
|
||||
if ($request->input('shifts_filter_day')) {
|
||||
$selected_day = $request->input('shifts_filter_day');
|
||||
}
|
||||
$shiftsFilter->setStartTime(parse_date('Y-m-d H:i', $selected_day . ' 00:00'));
|
||||
|
|
|
@ -41,7 +41,7 @@ function room_controller(): array
|
|||
if (!empty($days) && !in_array($selected_day, $days)) {
|
||||
$selected_day = $days[0];
|
||||
}
|
||||
if ($request->has('shifts_filter_day')) {
|
||||
if ($request->input('shifts_filter_day')) {
|
||||
$selected_day = $request->input('shifts_filter_day');
|
||||
}
|
||||
$shiftsFilter->setStartTime(parse_date('Y-m-d H:i', $selected_day . ' 00:00'));
|
||||
|
|
|
@ -63,6 +63,13 @@ class ShiftsFilterRenderer
|
|||
icon('speedometer2') . __('Dashboard')
|
||||
);
|
||||
}
|
||||
if (!request('showFilledShifts') && !auth()->can('user_shifts_admin')) {
|
||||
$toolbar[] = sprintf(
|
||||
'<li role="presentation"><a class="nav-link" href="%s">%s</a></li>',
|
||||
$page_link . '&showFilledShifts=1&showShiftsTab=1&shifts_filter_day=' . request('shifts_filter_day', $selected_day),
|
||||
icon('eye') . __('All')
|
||||
);
|
||||
}
|
||||
}
|
||||
return div('mb-3', [
|
||||
toolbar_pills($toolbar)
|
||||
|
|
Loading…
Reference in New Issue