Fix ics escaping and IDs
This commit is contained in:
parent
ab5f6a270c
commit
fc8d335ea2
|
@ -1,8 +1,8 @@
|
||||||
{% set dateFormat = 'Ymd\\THis\\Z' %}
|
{% set dateFormat = 'Ymd\\THis\\Z' %}
|
||||||
{% set replacement = {'\n': '\\n'} %}
|
{% set replacement = {'\\': '\\\\', ';': '\\;', ',': '\\,', '\n': '\\n'} %}
|
||||||
BEGIN:VCALENDAR
|
BEGIN:VCALENDAR
|
||||||
VERSION:2.0
|
VERSION:2.0
|
||||||
PRODID:-//-/{{ config('app_name') }}//DE
|
PRODID:-//-/{{ config('app_name') | replace(replacement) | raw }}//DE
|
||||||
CALSCALE:GREGORIAN
|
CALSCALE:GREGORIAN
|
||||||
{% for entry in shiftEntries %}
|
{% for entry in shiftEntries %}
|
||||||
BEGIN:VEVENT
|
BEGIN:VEVENT
|
||||||
|
@ -12,12 +12,14 @@ DTSTART:{{ entry.shift.start.utc().format(dateFormat) }}
|
||||||
DTEND:{{ entry.shift.end.utc().format(dateFormat) }}
|
DTEND:{{ entry.shift.end.utc().format(dateFormat) }}
|
||||||
STATUS:CONFIRMED
|
STATUS:CONFIRMED
|
||||||
TRANSP:OPAQUE
|
TRANSP:OPAQUE
|
||||||
SUMMARY:{{ entry.shift.shiftType.name ~ ' (' ~ entry.shift.title ~ ')' | replace(replacement) | raw }}
|
SUMMARY:{{ (entry.shift.shiftType.name ~ ' (' ~ entry.shift.title ~ ')') | replace(replacement) | raw }}
|
||||||
LOCATION:{{ entry.shift.room.name | replace(replacement) | raw }}
|
LOCATION:{{ entry.shift.room.name | replace(replacement) | raw }}
|
||||||
DESCRIPTION:{{
|
DESCRIPTION:{{
|
||||||
|
(
|
||||||
entry.shift.shiftType.description
|
entry.shift.shiftType.description
|
||||||
~ '\\n' ~ entry.shift.description
|
~ '\n' ~ entry.shift.description
|
||||||
~ '\\n' ~ entry.user_comment
|
~ '\n' ~ entry.user_comment
|
||||||
|
)
|
||||||
| replace(replacement) | raw
|
| replace(replacement) | raw
|
||||||
}}
|
}}
|
||||||
URL:{{ url('/shifts', {'action': 'view', 'shift_id': entry.shift.id}) | raw }}
|
URL:{{ url('/shifts', {'action': 'view', 'shift_id': entry.shift.id}) | raw }}
|
||||||
|
|
|
@ -152,6 +152,6 @@ class FeedController extends BaseController
|
||||||
->leftJoin('shifts', 'shifts.id', 'shift_entries.shift_id')
|
->leftJoin('shifts', 'shifts.id', 'shift_entries.shift_id')
|
||||||
->orderBy('shifts.start')
|
->orderBy('shifts.start')
|
||||||
->with(['shift', 'shift.room', 'shift.shiftType'])
|
->with(['shift', 'shift.room', 'shift.shiftType'])
|
||||||
->get();
|
->get(['*', 'shift_entries.id']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue