24 include_once(
'./Services/Calendar/classes/class.ilCalendarUserSettings.php');
25 include_once(
'./Services/Calendar/classes/class.ilDateTime.php');
26 include_once(
'./Services/Calendar/classes/class.ilCalendarRecurrenceCalculator.php');
27 include_once(
'./Services/Calendar/classes/class.ilCalendarEntry.php');
28 include_once(
'./Services/Calendar/classes/class.ilCalendarHidden.php');
77 $this->type = $a_type;
82 $this->user = $ilUser;
85 $this->weekstart = $this->user_settings->getWeekStart();
86 $this->timezone = $ilUser->getTimeZone();
98 $this->subitems_enabled = $a_status;
121 $fend = clone $fstart;
136 if($schedule[
'fullday'])
138 if(($f_unix_start == $schedule[
'dstart']) or
139 $f_unix_start == $schedule[
'dend'] or
140 ($f_unix_start > $schedule[
'dstart'] and $f_unix_end <= $schedule[
'dend']))
145 elseif(($schedule[
'dstart'] == $unix_start) or
146 (($schedule[
'dstart'] <= $unix_start) and ($schedule[
'dend'] > $unix_start)) or
147 (($schedule[
'dstart'] >= $unix_start) and ($schedule[
'dstart'] < $unix_end)))
152 return $tmp_schedule ? $tmp_schedule : array();
167 include_once(
'Services/Calendar/classes/class.ilCalendarRecurrences.php');
171 foreach($recs as $rec)
174 foreach($calc->calculateDateList($this->start,$this->end)->get() as $rec_date)
176 $this->schedule[$counter][
'event'] = $event;
177 $this->schedule[$counter][
'dstart'] = $rec_date->get(
IL_CAL_UNIX);
178 $this->schedule[$counter][
'dend'] = $this->schedule[$counter][
'dstart'] + $duration;
179 $this->schedule[$counter][
'fullday'] = $event->isFullday();
184 case self::TYPE_WEEK:
187 $this->schedule[$counter][
'start_info'] = $tmp_date->get(
IL_CAL_FKT_GETDATE,
'',$this->timezone);
190 $this->schedule[$counter][
'end_info'] = $tmp_date->get(
IL_CAL_FKT_GETDATE,
'',$this->timezone);
202 $this->schedule[$counter][
'event'] = $event;
203 $this->schedule[$counter][
'dstart'] = $event->getStart()->get(
IL_CAL_UNIX);
204 $this->schedule[$counter][
'dend'] = $event->getEnd()->get(
IL_CAL_UNIX);
205 $this->schedule[$counter][
'fullday'] = $event->isFullday();
207 if(!$event->isFullday())
212 case self::TYPE_WEEK:
215 $this->schedule[$counter][
'start_info'] = $tmp_date->get(
IL_CAL_FKT_GETDATE,
'',$this->timezone);
218 $this->schedule[$counter][
'end_info'] = $tmp_date->get(
IL_CAL_FKT_GETDATE,
'',$this->timezone);
242 include_once(
'./Services/Calendar/classes/class.ilCalendarCategories.php');
255 $query =
"SELECT ce.cal_id AS cal_id FROM cal_entries AS ce ".
256 "JOIN cal_category_assignments AS ca ON ca.cal_id = ce.cal_id ".
259 "ORDER BY last_update";
260 $res = $this->db->query($query);
264 if(!$this->hidden_cat->isAppointmentVisible($row->cal_id))
269 return $events ? $events : array();
282 include_once(
'./Services/Calendar/classes/class.ilCalendarCategories.php');
292 $query =
"SELECT ce.cal_id AS cal_id FROM cal_entries AS ce LEFT JOIN cal_recurrence_rules AS crr USING (cal_id) ".
293 "JOIN cal_category_assignments AS ca ON ca.cal_id = ce.cal_id ".
294 "WHERE ((start <= ".$this->db->quote($this->end->get(
IL_CAL_DATETIME,
'',
'UTC')).
" ".
295 "AND end >= ".$this->db->quote($this->start->get(
IL_CAL_DATETIME,
'',
'UTC')).
") ".
296 "OR (start <= ".$this->db->quote($this->end->get(
IL_CAL_DATETIME,
'',
'UTC')).
" ".
297 "AND NOT rule_id IS NULL)) ".
300 $res = $this->db->query($query);
304 if(!$this->hidden_cat->isAppointmentVisible($row->cal_id))
315 return $events ? $events : array();
330 $this->start = clone $seed;
331 $this->end = clone $seed;
336 case self::TYPE_WEEK:
337 $this->start = clone $seed;
339 $day_diff = $this->weekstart - $start_info[
'isoday'];
344 $this->start->increment(
IL_CAL_DAY,$day_diff);
350 case self::TYPE_MONTH:
352 list($year,$month) = explode(
'-',$year_month);