简体   繁体   English

Outlook 未在 ics 文件中导入多个事件

[英]Outlook not importing multiple events in an ics file

I have an issue with a generated iCal file.我有一个生成的 iCal 文件的问题。

It appears to be generating the code correctly and the .ics file is loaded with multiple events, however when I open the file in outlook it only imports the first event into my calendar and the rest are not added.它似乎正确生成了代码,并且 .ics 文件加载了多个事件,但是当我在 Outlook 中打开文件时,它只将第一个事件导入到我的日历中,其余的没有添加。

Here is the Generated iCal File这是生成的 iCal 文件

BEGIN:VCALENDAR
PRODID:-//Microsoft Corporation//Outlook 12.0 MIMEDIR//EN
VERSION:2.0
METHOD:PUBLISH
X-WR-CALNAME: Calendar
CALSCALE:GREGORIAN
X-MS-OLK-FORCEINSPECTOROPEN:TRUE
BEGIN:VTIMEZONE
TZID:Europe/London
BEGIN:DAYLIGHT
TZOFFSETFROM:+0000
TZOFFSETTO:+0100
DTSTART:19810329T010000
RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=-1SU
TZNAME:BST
END:DAYLIGHT
BEGIN:STANDARD
TZOFFSETFROM:+0100
TZOFFSETTO:+0000
DTSTART:19961027T020000
RRULE:FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU
TZNAME:GMT
END:STANDARD
END:VTIMEZONE
BEGIN:VEVENT
DTSTART:20140906T090000
DTEND:20140906T170000
UID:224
DTSTAMP:20140721T102908
LOCATION:
DESCRIPTION:Explore the College with current students\, chat with the Director of Studies in your subject\, meet our admissions tutors\,
URL;VALUE=URI:http://www.domain.com/events-224
SUMMARY:Open Day (undergraduate)
END:VEVENT
BEGIN:VEVENT
DTSTART:20141208T000000
DTEND:20141212T000000
UID:416
DTSTAMP:20140721T102908
LOCATION:
DESCRIPTION:Admissions Interviews
URL;VALUE=URI:http://www.domain.com/events-416
SUMMARY:Admissions Interviews
END:VEVENT
BEGIN:VEVENT
DTSTART:20141215T000000
DTEND:20141218T000000
UID:417
DTSTAMP:20140721T102908
LOCATION:
DESCRIPTION:Admissions Interviews
URL;VALUE=URI:http://www.domain.com/events-417
SUMMARY:Admissions Interviews
END:VEVENT
BEGIN:VEVENT
DTSTART:20150112T000000
DTEND:20150116T000000
UID:419
DTSTAMP:20140721T102908
LOCATION:
DESCRIPTION:Admissions Interviews
URL;VALUE=URI:http://www.domain.com/events-419
SUMMARY:Admissions Interviews
END:VEVENT
BEGIN:VEVENT
DTSTART:20150314T000000
DTEND:20150314T000000
UID:67
DTSTAMP:20140721T102908
LOCATION:
DESCRIPTION:Explore the College with current students\, chat with the Director of Studies in your subject and meet our admissions tutors. 

URL;VALUE=URI:http://www.domain.com/events-67
SUMMARY:Admissions Open Day (Arts)
END:VEVENT
BEGIN:VEVENT
DTSTART:20150425T000000
DTEND:20150425T000000
UID:73
DTSTAMP:20140721T102908
LOCATION:
DESCRIPTION:Explore the College with current students\, chat with the Director of Studies in your subject and meet our admissions tutors.
URL;VALUE=URI:http://www.domain.com/events-73
SUMMARY:Admissions Open Day (Sciences)
END:VEVENT
END:VCALENDAR

The following is the variables for setting the header and footer of the iCal file以下是设置iCal文件页眉页脚的变量

$iCalHeader = "" .
        "BEGIN:VCALENDAR\n" .
        "PRODID:-//Microsoft Corporation//Outlook 12.0 MIMEDIR//EN\n" .
        "VERSION:2.0\n" .
        "METHOD:PUBLISH\n";

    $iCalHeaderBottom = "CALSCALE:GREGORIAN\n" .
        "X-MS-OLK-FORCEINSPECTOROPEN:TRUE\n" .
        "BEGIN:VTIMEZONE\n" .
        "TZID:Europe/London\n" .
        "BEGIN:DAYLIGHT\n" .
        "TZOFFSETFROM:+0000\n" .
        "TZOFFSETTO:+0100\n" .
        "DTSTART:19810329T010000\n" .
        "RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=-1SU\n" .
        "TZNAME:BST\n" .
        "END:DAYLIGHT\n" .
        "BEGIN:STANDARD\n" .
        "TZOFFSETFROM:+0100\n" .
        "TZOFFSETTO:+0000\n" .
        "DTSTART:19961027T020000\n" .
        "RRULE:FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU\n" .
        "TZNAME:GMT\n" .
        "END:STANDARD\n" .
        "END:VTIMEZONE\n";

    $iCalFooter = "END:VCALENDAR";

And finally the code that generates the event最后是生成事件的代码

$iCal .= "BEGIN:VEVENT\n".
                "DTSTART:" . date('Ymd\THis', strtotime($row2["EVENT_StartDateTime"])) ."\n".
                "DTEND:" . date('Ymd\THis', strtotime($row2["EVENT_EndDateTime"])) . "\n".
                "UID:" . $row2["EVENT_ID"] . "\n".
                "DTSTAMP:" . date('Ymd\THis', time()) . "\n".
                "LOCATION:$address\n".
                "DESCRIPTION:" . $this->escapeString($description) . "\n".
                "URL;VALUE=URI:http://www.domain.com/events-" . $row2["EVENT_ID"] . "\n".
                "SUMMARY:" . $this->escapeString($title) . "\n".
                "END:VEVENT\n";

It works for the first event so I don't think it's a problem with the code that's generated for each event, I have done a little researching but I can't seem to find a solution, is there an extra statement that needs to be used between each event?它适用于第一个事件,所以我不认为这是为每个事件生成的代码的问题,我做了一些研究,但似乎找不到解决方案,是否需要额外声明在每个事件之间使用?

Or perhaps outlook does not support multiple events in a single iCal and therefore only imports the first one?或者 Outlook 不支持单个 iCal 中的多个事件,因此只导入第一个?

any help or suggestions would be greatly appreciated.任何帮助或建议将不胜感激。

Thanks in advance.提前致谢。

Your Icalendar passes this validator , but try adding an ORGANIZER for each event. 您的Icalendar通过了此验证器 ,但请尝试为每个事件添加一个ORGANIZER。 This field is mandatory by my reading of the spec . 对规范的阅读是必填项。

This could be a problem of expectations. 这可能是期望的问题。 When you say "importing", how are you sending/opening the calendar and what do you expect to happen? 当您说“导入”时,您如何发送/打开日历以及您期望发生什么? In general, outlook and other clients have two treatments for Icalendars. 通常,Outlook和其他客户对Icalendars有两种治疗方法。 If the Icalendar contains one event, has METHOD=REQUEST, and is lucky , it will be displayed as an invitation, with a button to directly add it to the user's calendar. 如果Icalendar包含一个事件,具有METHOD = REQUEST,并且很幸运 ,它将显示为邀请,并带有将其直接添加到用户日历的按钮。 (If it is very lucky, and the recipient's email is in the attendee field, the event may display in the calendar greyed out before it has been previewed or opened in a mail view. Otherwise is will appear after it has been previewed.) (如果非常幸运,并且收件人的电子邮件在与会者字段中,则该事件可能在日历中显示为灰色,然后才进行预览或在邮件视图中打开。否则在预览后会出现。)

If it has more than one event, or any number of other little problems, it will be displayed as an attachment (if received by mail) and the user will have to grub around to open it. 如果它有多个事件或其他许多小问题,它将显示为附件(如果通过邮件收到),用户将不得不四处打开它。 Multi event calendars, received by mail or opened from an URL, are treated as a separate calendars. 通过邮件接收或从URL打开的多事件日历被视为单独的日历。 There is no proposition to add their events to the user's calendar, but the user can select and drag the events if they know what they're doing. 没有建议将其事件添加到用户的日历中,但是如果用户知道自己在做什么,则可以选择并拖动事件。

Probably way to late to answer this question, but might help others. 可能是很晚才回答这个问题的方法,但可能会帮助其他人。

https://docs.microsoft.com/en-us/openspecs/exchange_server_protocols/ms-oxcical/d2a0a079-02a6-4643-9e78-0ac35998e1fb https://docs.microsoft.com/zh-cn/openspecs/exchange_server_protocols/ms-oxcical/d2a0a079-02a6-4643-9e78-0ac35998e1fb

X-MS-OLK-FORCEINSPECTOROPEN X-MS-OLK-FORCEINSPECTOROPEN

If this property is set to TRUE, the iCalendar stream SHOULD<18> be imported as a single Calendar object, regardless of the number of VEVENT components present in the iCalendar. 如果此属性设置为TRUE,则应将iCalendar流作为单个Calendar对象导入,而不管iCalendar中存在的VEVENT组件数目如何。 Note that it is possible for an iCalendar file containing multiple VEVENT components to represent a single appointment through the use of the RECURRENCE-ID property specified in section 请注意,包含多个VEVENT组件的iCalendar文件有可能通过使用本节中指定的RECURRENCE-ID属性来表示单个约会。

This happens if you open the calendar.如果您打开日历,就会发生这种情况。 If you import it, then it works fine:如果你导入它,那么它工作正常: 在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM