Merge pull request #23913 from seamuslee001/symfony_upgrade
[civicrm-core.git] / templates / CRM / Core / Calendar / ICal.tpl
1 {*
2 +--------------------------------------------------------------------+
3 | Copyright CiviCRM LLC. All rights reserved. |
4 | |
5 | This work is published under the GNU AGPLv3 license with some |
6 | permitted exceptions and without any warranty. For full license |
7 | and copyright information, see https://civicrm.org/licensing |
8 +--------------------------------------------------------------------+
9 *}
10 BEGIN:VCALENDAR
11 VERSION:2.0
12 PRODID:-//CiviCRM//NONSGML CiviEvent iCal//EN
13 X-WR-TIMEZONE:{$timezone}
14 METHOD:PUBLISH
15 {foreach from=$timezones item=tzItem}
16 BEGIN:VTIMEZONE
17 TZID:{$tzItem.id}
18 {foreach from=$tzItem.transitions item=tzTr}
19 BEGIN:{$tzTr.type}
20 TZOFFSETFROM:{$tzTr.offset_from}
21 TZOFFSETTO:{$tzTr.offset_to}
22 TZNAME:{$tzTr.abbr}
23 {if $tzTr.dtstart}
24 DTSTART:{$tzTr.dtstart|crmICalDate}
25 {/if}
26 END:{$tzTr.type}
27 {/foreach}
28 END:VTIMEZONE
29 {/foreach}
30 {foreach from=$events key=uid item=event}
31 BEGIN:VEVENT
32 UID:{$event.uid}
33 SUMMARY:{$event.title|crmICalText}
34 {if $event.description}
35 X-ALT-DESC;FMTTYPE=text/html:{$event.description|crmICalText:true:29}
36 DESCRIPTION:{$event.description|crmICalText}
37 {/if}
38 {if $event.event_type}
39 CATEGORIES:{$event.event_type|crmICalText}
40 {/if}
41 CALSCALE:GREGORIAN
42 {if $event.start_date}
43 DTSTAMP;TZID={$timezone}:{$event.start_date|crmICalDate}
44 DTSTART;TZID={$timezone}:{$event.start_date|crmICalDate}
45 {else}
46 DTSTAMP;TZID={$timezone}:{$smarty.now|crmDate:'%Y-%m-%d %H:%M:%S'|crmICalDate}
47 {/if}
48 {if $event.end_date}
49 DTEND;TZID={$timezone}:{$event.end_date|crmICalDate}
50 {else}
51 DTEND;TZID={$timezone}:{$event.start_date|crmICalDate}
52 {/if}
53 {if $event.is_show_location EQ 1 && $event.location}
54 LOCATION:{$event.location|crmICalText}
55 {/if}
56 {if $event.contact_email}
57 ORGANIZER:MAILTO:{$event.contact_email|crmICalText}
58 {/if}
59 {if $event.url}
60 URL:{$event.url}
61 {/if}
62 END:VEVENT
63 {/foreach}
64 END:VCALENDAR