diff --git a/entity/Appointment_entity/contentProcess.js b/entity/Appointment_entity/contentProcess.js index 927ff03b31f8e3c4ae557c6c99f25a076cbca914..633c2abfe2c16ab722a8deb291b2e6ed80ea32df 100644 --- a/entity/Appointment_entity/contentProcess.js +++ b/entity/Appointment_entity/contentProcess.js @@ -6,9 +6,16 @@ import("system.datetime"); import("system.eMath"); import("system.util"); +// $param.entry is potentially a recurrence exception. if(vars.exists("$param.entry")) { var entry = JSON.parse(vars.getString("$param.entry")); + var masterEntry = null; + if (vars.exists("$param.masterEntry") && vars.get("$param.masterEntry") != "") { + masterEntry = JSON.parse(vars.get("$param.masterEntry")); + } + + logging.log("Appointment is recurrence exception: " + (masterEntry != null)) var uid = entry[calendars.ID]; var summary = entry[calendars.SUMMARY]; @@ -26,11 +33,24 @@ if(vars.exists("$param.entry")) var transparency = entry[calendars.TRANSPARENCY]; var categories = entry[calendars.CATEGORIES]; + var masterBegin = masterEntry != null ? masterEntry[calendars.DTSTART] : null + var masterEnd = masterEntry != null ? masterEntry[calendars.DTEND] : null + + // Recurrence + var recurrenceID = entry[calendars.RECURRENCEID]; + var rrule = null; + if (masterEntry != null) { // Entry is a recurrence exception, therefore get rrule from master + rrule = masterEntry[calendars.RRULE] != null ? masterEntry[calendars.RRULE][0] : null; + } else { + rrule = entry[calendars.RRULE] != null ? entry[calendars.RRULE][0] : null; + } + //@TODO Icon - result.object([ - [uid, '', '', attendees.length, startdate, enddate, summary, organizer, attendees, status, links, description, location, '', classification, transparency, categories] //reminder, remindercheck - ]); + [uid, '', '', attendees.length, startdate, enddate, summary, organizer, + attendees, status, links, description, location, '', classification, + transparency, categories, rrule, recurrenceID, null, masterBegin, masterEnd] //reminder, remindercheck + ]); } else {