{% set periodStartDate = timestamp2UTC(today) %} {% set displayEndDate = today|date_modify("+" ~ intervall ~ "day")|date('U') %} {% set periodEndDate = timestamp2UTC(displayEndDate) %} {% use 'Reservations/_reservation_table_day.html.twig' %} {% set firstWasSummer = today|date('I') %} {% set lastWeek = today|date('W') %} {% set colCount = 0 %} {% for i in 0..intervall %} {% set addToDate = "+" ~ i ~ "day" %} {% set tmpDate = today|date_modify(addToDate) %} {# if there is a change from summer to winter time #} {% if firstWasSummer == 1 and tmpDate|date('I') == 0 %} {% set tmpDate = tmpDate|date_modify("+1 hour") %} {% endif %} {% set curWeek = tmpDate|date('W') %} {# add 2 to colcount since we are at the end of the displayed period but add it only if the last day is not a monday (last cw was already printed #} {% if i == intervall and colCount != (2*7) %}{% set colCount = colCount + 2 %}{% endif %} {# be aware that when the last cw is printed while we are on monday already #} {% if lastWeek != curWeek or i == intervall %} {% set colCount = 2 %} {% set lastWeek = curWeek %} {# if we reached the end of the period and last day is a monday we need to print the last td #} {% if tmpDate|date('N') == 1 and i == intervall %} {% endif %} {% else %} {% set colCount = colCount + 2 %} {% endif %} {% endfor %} {% set firstWasSummer = today|date('I') %} {% for i in 0..intervall %} {% set addToDate = "+" ~ i ~ "day" %} {% set tmpDate = today|date_modify(addToDate) %} {# if there is a change from summer to winter time #} {% if firstWasSummer == 1 and tmpDate|date('I') == 0 %} {% set tmpDate = tmpDate|date_modify("+1 hour") %} {% endif %} {# check for weekend #} {% if tmpDate|date('N') == 6 or tmpDate|date('N') == 7 %} {% set weekendCss = ' reservation-table-weekend' %} {% else %} {% set weekendCss = '' %} {% endif %} {# Holidays #} {% if selectedSubdivision == 'all' %} {% set showCountry = holidayCountry %} {% else %} {% set showCountry = selectedSubdivision %} {% endif %} {% set publicdays = getPublicdaysForDay(tmpDate, showCountry, app.request.locale) %} {% set holidayText = "" %} {% for holiday in publicdays %} {% set holidayText = holidayText ~ holiday.name %} {% if loop.last == false %} {% set holidayText = holidayText ~ "
" %} {% endif %} {% endfor %} {% if holidayText|length > 0 %} {% set holidayPopover = 'data-bs-container="body" data-bs-toggle="popover" data-bs-placement="top" data-bs-content="' ~ holidayText ~ '" data-bs-trigger="hover" data-bs-html="true"' %} {% set holidayCss = " bg-info bg-opacity-25 holiday-info" %} {% else %} {% set holidayPopover = "" %} {% set holidayCss = "" %} {% endif %} {% endfor %} {% for appartment in appartments %} {% set reservations = get_reservations_for_period(today, intervall, appartment) %} {% if appartment.multipleOccupancy %} {% set multipleReservations = getReservationsMultipleOccupancy(reservations) %} {% set printReservations = attribute(multipleReservations, 0) is defined ? attribute(multipleReservations, 0) : [] %} {% else %} {% set printReservations = reservations %} {% endif %} {% set j = 0 %} {# empty tds between a reservation will get a different number so we can prevent, that user selects a new reservation over an existing #} {% set emptyTdNr = 0 %} {% set roomInfo = 'appartment.bedsmax'|trans ~ ": " ~ appartment.bedsMax %} {% if appartment.multipleOccupancy %} {% set roomInfo = roomInfo ~ ' ' %} {% endif %} {% with %} {% set reservations = printReservations %} {{ block('table_day') }} {% endwith %} {% if appartment.multipleOccupancy and multipleReservations|length > 1 %} {% for i in 1..multipleReservations|length-1 %} {% with %} {% set reservations = attribute(multipleReservations, i) %} {{ block('table_day') }} {% endwith %} {% endfor %} {% endif %} {% endfor %}
{{ 'reservation.table.calendarweek'|trans }} {{ lastWeek }}{{ 'reservation.table.calendarweek'|trans }} {{ curWeek }}
{{ 'reservation.appartment.name'|trans }}{{ tmpDate|date('d') }}
{{ appartment.number }}{% if appartment.roomCategory.acronym|length > 0 %} ({{ appartment.roomCategory.acronym }}){% endif %}