79 $strSql =
"SELECT DISTINCT "
81 .
", " . $DB->DateToCharFunction(
'p.DATE_FROM') .
" as DATE_FROM"
82 .
", " . $DB->DateToCharFunction(
'p.DATE_TO') .
" as DATE_TO"
83 .
", " . $DB->DateToCharFunction(
'p.DATE_CREATE') .
" as DATE_CREATE"
84 .
", " . $DB->DateToCharFunction(
'p.TIMESTAMP_X') .
" as TIMESTAMP_X"
85 .
", s.CAL_DAV_CON as CONNECTION_ID"
86 .
", s.GAPI_CALENDAR_ID as GAPI_CALENDAR_ID"
87 .
", GROUP_CONCAT(". $DB->DateToCharFunction(
'i.DATE_FROM').
" SEPARATOR ';') as EXDATE"
88 .
" FROM b_calendar_event p"
89 .
" INNER JOIN b_calendar_event i"
90 .
" ON i.RECURRENCE_ID = p.PARENT_ID"
91 .
" AND p.OWNER_ID = i.OWNER_ID"
92 .
" INNER JOIN b_calendar_section s"
93 .
" ON s.ID = p.SECTION_ID"
95 .
" p.RRULE IS NOT NULL"
96 .
" AND p.DATE_TO_TS_UTC >= " . $this->getSyncTimestamp()
97 .
" AND p.G_EVENT_ID IS NOT NULL"
98 .
" AND p.SYNC_STATUS != '" . Dictionary::SYNC_STATUS[
'exdated'] .
"'"
99 .
" AND p.SYNC_STATUS != '" . Dictionary::SYNC_STATUS[
'delete'] .
"'"
100 .
" AND p.SYNC_STATUS != '" . Dictionary::SYNC_STATUS[
'deleted'] .
"'"
101 .
" AND i.MEETING_STATUS = 'N'"
102 .
" AND s.EXTERNAL_TYPE = 'local'"
103 .
" AND s.CAL_DAV_CON IS NOT NULL"
104 .
" AND s.GAPI_CALENDAR_ID IS NOT NULL"
109 $eventsDb = $DB->Query($strSql);
111 while ($event = $eventsDb->Fetch())
113 if (isset($event[
'REMIND']) && $event[
'REMIND'] !==
"")
115 $event[
'REMIND'] = unserialize($event[
'REMIND'], [
'allowed_classes' =>
false]);
118 $event[
'RRULE'] = \CCalendarEvent::ParseRRULE($event[
'RRULE']);