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');
82 if(!$a_user_id || $a_user_id == $ilUser->getId())
91 $this->weekstart = $this->user_settings->getWeekStart();
97 include_once(
'./Services/Calendar/classes/class.ilCalendarCategories.php');
106 include_once(
'./Services/Calendar/classes/class.ilCalendarScheduleFilterHidden.php');
112 include_once(
'./Services/Calendar/classes/class.ilCalendarScheduleFilterBookings.php');
117 include_once
'./Services/Calendar/classes/class.ilCalendarScheduleFilterExercise.php';
129 return $this->limit_events != -1;
147 $this->limit_events = $a_limit;
157 $this->subitems_enabled = $a_status;
176 $this->filters[] = $a_filter;
190 $fend = clone $fstart;
203 $tmp_schedule =
array();
206 if($schedule[
'fullday'])
208 if(($f_unix_start == $schedule[
'dstart'])
or 209 $f_unix_start == $schedule[
'dend']
or 210 ($f_unix_start > $schedule[
'dstart']
and $f_unix_end <= $schedule[
'dend']))
215 elseif(($schedule[
'dstart'] == $unix_start)
or 216 (($schedule[
'dstart'] <= $unix_start)
and ($schedule[
'dend'] > $unix_start))
or 217 (($schedule[
'dstart'] >= $unix_start)
and ($schedule[
'dstart'] < $unix_end)))
222 return $tmp_schedule;
237 foreach($events as $event)
239 $ids[] = $event->getEntryId();
242 include_once(
'Services/Calendar/classes/class.ilCalendarCategoryAssignments.php');
244 include_once(
'Services/Calendar/classes/class.ilCalendarCategory.php');
245 $cat_types =
array();
246 foreach(array_unique($cat_map) as $cat_id)
249 $cat_types[$cat_id] = $cat->getType();
253 foreach($events as $event)
256 include_once(
'Services/Calendar/classes/class.ilCalendarRecurrences.php');
260 foreach($recs as $rec)
263 foreach($calc->calculateDateList($this->start,$this->end)->get() as $rec_date)
265 if($this->type == self::TYPE_PD_UPCOMING &&
271 $this->schedule[
$counter][
'event'] = $event;
274 $this->schedule[
$counter][
'fullday'] = $event->isFullday();
275 $this->schedule[
$counter][
'category_id'] = $cat_map[$event->getEntryId()];
276 $this->schedule[
$counter][
'category_type'] = $cat_types[$cat_map[$event->getEntryId()]];
281 case self::TYPE_WEEK:
294 if($this->type != self::TYPE_PD_UPCOMING &&
305 $this->schedule[
$counter][
'event'] = $event;
308 $this->schedule[
$counter][
'fullday'] = $event->isFullday();
309 $this->schedule[
$counter][
'category_id'] = $cat_map[$event->getEntryId()];
310 $this->schedule[
$counter][
'category_type'] = $cat_types[$cat_map[$event->getEntryId()]];
312 if(!$event->isFullday())
317 case self::TYPE_WEEK:
331 if($this->type != self::TYPE_PD_UPCOMING &&
339 if($this->type == self::TYPE_PD_UPCOMING)
344 $this->schedule = array_slice($this->schedule, 0, $this->
getEventsLimit());
361 foreach($this->filters as $filter)
365 $a_cats = $filter->filterCategories($a_cats);
374 foreach($this->filters as $filter)
376 $res = $filter->modifyEvent($event);
389 $new_events =
array();
390 foreach($this->filters as $filter)
392 $events_by_filter = $filter->addCustomEvents($start, $end, $categories);
393 if($events_by_filter)
395 $new_events = array_merge($new_events, $events_by_filter);
413 include_once(
'./Services/Calendar/classes/class.ilCalendarCategories.php');
425 $query =
"SELECT ce.cal_id cal_id FROM cal_entries ce ".
426 "JOIN cal_cat_assignments ca ON ca.cal_id = ce.cal_id ".
428 "AND ".$ilDB->in(
'ca.cat_id',$cats,
false,
'integer').
' '.
429 "ORDER BY last_update";
438 $events[] = $valid_event;
442 foreach($this->
addCustomEvents($this->start, $this->end, $cats) as $event)
447 return $events ? $events :
array();
460 include_once(
'./Services/Calendar/classes/class.ilCalendarCategories.php');
470 $query =
"SELECT ce.cal_id cal_id".
471 " FROM cal_entries ce".
472 " LEFT JOIN cal_recurrence_rules crr ON (ce.cal_id = crr.cal_id)".
473 " JOIN cal_cat_assignments ca ON (ca.cal_id = ce.cal_id)";
475 if($this->type != self::TYPE_INBOX)
477 $query .=
" WHERE ((starta <= ".$this->db->quote($this->end->get(
IL_CAL_DATETIME,
'',
'UTC'),
'timestamp').
478 " AND enda >= ".$this->db->quote($this->start->get(
IL_CAL_DATETIME,
'',
'UTC'),
'timestamp').
")".
479 " OR (starta <= ".$this->db->quote($this->end->get(
IL_CAL_DATETIME,
'',
'UTC'),
'timestamp').
480 " AND NOT rule_id IS NULL))";
488 $query .=
" AND ".$ilDB->in(
'ca.cat_id',$cats,
false,
'integer').
500 $events[] = $valid_event;
504 foreach($this->
addCustomEvents($this->start, $this->end, $cats) as $event)
524 $this->start = clone $seed;
525 $this->end = clone $seed;
530 case self::TYPE_WEEK:
531 $this->start = clone $seed;
533 $day_diff = $this->weekstart - $start_info[
'isoday'];
538 $this->start->increment(
IL_CAL_DAY,$day_diff);
544 case self::TYPE_MONTH:
546 list($year,$month) = explode(
'-',$year_month);
555 case self::TYPE_PD_UPCOMING:
556 case self::TYPE_INBOX:
557 $this->start = $seed;
static _getRecurrences($a_cal_id)
get all recurrences of an appointment
Model for a calendar entry.
areEventsLimited()
Check if events are limited.
modifyEventByFilters(ilCalendarEntry $event)
getEventsLimit()
get current limit of events
Calendar schedule filter for consultation hour bookings.
static _getInstanceByUserId($a_user_id)
get singleton instance
enabledSubitemCalendars()
Are subitem calendars enabled.
addSubitemCalendars($a_status)
Enable subitem calendars (session calendars for courses)
Stores calendar categories.
filterCategories(array $a_cats)
setEventsLimit($a_limit)
Set events limit.
getByDay(ilDate $a_start, $a_timezone)
get byday
static sortArray($array, $a_array_sortby, $a_array_sortorder=0, $a_numeric=false, $a_keep_keys=false)
sortArray
get($a_format, $a_format_str='', $a_tz='')
get formatted date
static _getMaxDayOfMonth($a_year, $a_month)
get max day of month 2008,2 => 29
Calendar schedule filter for hidden categories.
Calendar schedule filter interface.
Calculates an ilDateList for a given calendar entry and recurrence rule.
date( 'd-M-Y', $objPHPExcel->getProperties() ->getCreated())
Calendar schedule filter for exercises.
const MODE_PORTFOLIO_CONSULTATION
get($a_format, $a_format_str='', $a_tz='')
get formatted date
increment($a_type, $a_count=1)
increment
static _getInstance($a_usr_id=0)
get singleton instance
getEvents()
Read events (will be moved to another class, since only active and/or visible calendars are shown) ...
Create styles array
The data for the language used.
initPeriod(ilDate $seed)
init period of events
__construct(ilDate $seed, $a_type, $a_user_id=0)
Constructor.
addFilter(ilCalendarScheduleFilter $a_filter)
Add filter.
getChangedEvents($a_include_subitem_calendars=false)
get new/changed events
static getLogger($a_component_id)
Get component logger.
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.
addCustomEvents(ilDate $start, ilDate $end, array $categories)
Represents a list of calendar appointments (including recurring events) for a specific user in a give...
static _getAppointmentCalendars($a_cal_ids)
lookup calendars for appointment ids