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);
240 global $ilUser,
$ilDB;
242 include_once(
'./Services/Calendar/classes/class.ilCalendarCategories.php');
254 $query =
"SELECT ce.cal_id cal_id FROM cal_entries ce ".
255 "JOIN cal_cat_assignments ca ON ca.cal_id = ce.cal_id ".
257 "AND ".$ilDB->in(
'ca.cat_id',$cats,
false,
'integer').
' '.
258 "ORDER BY last_update";
263 if(!$this->hidden_cat->isAppointmentVisible(
$row->cal_id))
268 return $events ? $events : array();
279 global $ilUser,
$ilDB;
281 include_once(
'./Services/Calendar/classes/class.ilCalendarCategories.php');
291 $query =
"SELECT ce.cal_id cal_id FROM cal_entries ce LEFT JOIN cal_recurrence_rules crr ON ce.cal_id = crr.cal_id ".
292 "JOIN cal_cat_assignments ca ON ca.cal_id = ce.cal_id ".
293 "WHERE ((starta <= ".$this->db->quote($this->end->get(
IL_CAL_DATETIME,
'',
'UTC'),
'timestamp').
" ".
294 "AND enda >= ".$this->db->quote($this->start->get(
IL_CAL_DATETIME,
'',
'UTC'),
'timestamp').
") ".
295 "OR (starta <= ".$this->db->quote($this->end->get(
IL_CAL_DATETIME,
'',
'UTC'),
'timestamp').
" ".
296 "AND NOT rule_id IS NULL)) ".
297 "AND ".$ilDB->in(
'ca.cat_id',$cats,
false,
'integer').
" ".
303 if(!$this->hidden_cat->isAppointmentVisible(
$row->cal_id))
314 return $events ? $events : array();
329 $this->start = clone $seed;
330 $this->end = clone $seed;
335 case self::TYPE_WEEK:
336 $this->start = clone $seed;
338 $day_diff = $this->weekstart - $start_info[
'isoday'];
343 $this->start->increment(
IL_CAL_DAY,$day_diff);
349 case self::TYPE_MONTH:
351 list($year,$month) = explode(
'-',$year_month);