24 include_once(
'Services/Calendar/classes/class.ilTimeZone.php');
108 $ilDB = $DIC[
'ilDB'];
126 if (self::$instance) {
127 return self::$instance;
138 if (!self::lookupCalendarActivated($obj_id)) {
141 $settings = self::_getInstance();
143 $default = $settings->isObjectCalendarVisible(
$type);
146 'cont_show_calendar',
161 $gl_activated =
false;
175 include_once
'./Services/Container/classes/class.ilContainer.php';
178 'cont_activation_calendar',
190 $this->cache_enabled = $a_status;
209 $this->cache_minutes = $a_min;
229 $this->enabled = $a_enabled;
251 $this->week_start = $a_start;
305 $this->timezone = $a_zone;
327 $this->date_format = $a_format;
338 return $this->date_format;
350 $this->time_format = $a_format;
380 $this->day_start = $a_start;
399 $this->day_end = $a_end;
417 $this->consultation_hours = $a_status;
440 $this->enablegroupmilestones = $a_enablegroupmilestones;
450 return $this->enablegroupmilestones;
468 $this->sync_cache_enabled = $a_status;
478 $this->sync_cache_minutes = $a_min;
516 $this->notification_user = $a_not;
526 $this->cg_registration = $a_status;
536 $this->course_cal_enabled = $a_stat;
551 $this->course_cal_visible = $status;
567 $this->group_cal_enabled = $a_stat;
582 $this->group_cal_visible = $status;
587 $this->webcal_sync = $a_stat;
597 $this->webcal_sync_hours = $a_hours;
612 $this->show_weeks = $a_val;
627 $this->batch_file_downloads = $a_stat;
642 $this->storage->set(
'enabled', (
int) $this->
isEnabled());
653 $this->storage->set(
'cache_enabled', (
int) $this->
isCacheUsed());
664 $this->storage->set(
'show_weeks', (
int) $this->
getShowWeeks());
666 $this->storage->set(
'default_calendar_view', (
int) $this->
getDefaultCal());
679 $this->
setEnabled($this->storage->get(
'enabled'));
681 $this->
setDefaultWeekStart($this->storage->get(
'default_week_start', self::WEEK_START_MONDAY));
685 $this->
setDefaultDayStart($this->storage->get(
'default_day_start', self::DEFAULT_DAY_START));
686 $this->
setDefaultDayEnd($this->storage->get(
'default_day_end', self::DEFAULT_DAY_END));
688 $this->
setCacheMinutes($this->storage->get(
'cache_minutes', self::DEFAULT_CACHE_MINUTES));
691 $this->
enableNotification($this->storage->get(
'notification', $this->isNotificationEnabled()));
692 $this->
enableConsultationHours($this->storage->get(
'consultation_hours', $this->areConsultationHoursEnabled()));
693 $this->
enableCGRegistration($this->storage->get(
'cg_registration', $this->isCGRegistrationEnabled()));
694 $this->
enableCourseCalendar($this->storage->get(
'course_cal', $this->isCourseCalendarEnabled()));
696 $this->
enableGroupCalendar($this->storage->get(
'group_cal', $this->isGroupCalendarEnabled()));
698 $this->
enableUserNotification($this->storage->get(
'notification_user', $this->isUserNotificationEnabled()));
699 $this->
enableWebCalSync($this->storage->get(
'webcal_sync', $this->isWebCalSyncEnabled()));
700 $this->
setWebCalSyncHours($this->storage->get(
'webcal_sync_hours', $this->getWebCalSyncHours()));
701 $this->
setShowWeeks($this->storage->get(
'show_weeks', $this->getShowWeeks()));
703 $this->
setDefaultCal($this->storage->get(
'default_calendar_view', $this->getDefaultCal()));
704 $this->
setDefaultPeriod($this->storage->get(
'default_period', $this->getDefaultPeriod()));
716 $query =
"SELECT ref_id FROM object_reference obr " .
717 "JOIN object_data obd ON obd.obj_id = obr.obj_id " .
718 "WHERE type = 'cals'";
720 $set = $this->db->query(
$query);
721 $row = $this->db->fetchAssoc($set);
723 $this->cal_settings_id = $row[
"ref_id"];
734 include_once(
'./Services/Administration/classes/class.ilSetting.php');
735 $this->storage =
new ilSetting(
'calendar');
getDefaultTimeFormat()
get default time format
static _getDefaultTimeZone()
Calculate and set default time zone.
getCacheMinutes()
Get cache minutes.
getDefaultTimeZone()
get derfault time zone
setSynchronisationCacheMinutes($a_min)
Set synchronisation cache minutes.
static _getInstance()
get singleton instance
getDefaultWeekStart()
get default week start
enableConsultationHours($a_status)
En/Disable consultation hours.
isNotificationEnabled()
Course group notification enabled.
enableWebCalSync($a_stat)
isCacheUsed()
Check if cache is used.
setShowWeeks($a_val)
Set show weeks.
setWebCalSyncHours($a_hours)
setDefaultDayStart($a_start)
Set default start of day.
getShowWeeks()
Get show weeks.
setDefaultDateFormat($a_format)
set default date format
setEnableGroupMilestones($a_enablegroupmilestones)
Set Enable milestone planning feature for groups.
isBatchFileDownloadsEnabled()
isCourseCalendarVisible()
static lookupCalendarActivated($a_obj_id)
getDefaultDateFormat()
get default date format
isUserNotificationEnabled()
setDefaultDayEnd($a_end)
set default end of day
setDefaultTimeFormat($a_format)
set default time format
getCalendarSettingsId()
Get calendar settings id (Used for permission checks)
const DEFAULT_SYNC_CACHE_MINUTES
getDefaultDayStart()
Get default end of day.
getSynchronisationCacheMinutes()
get synchronisation cache minutes
getDefaultDayEnd()
Get default end of day.
setCacheMinutes($a_min)
Set time of cache storage.
isCGRegistrationEnabled()
areConsultationHoursEnabled()
Check if consultation hours are enabled.
setDefaultTimeZone($a_zone)
set default timezone
enableUserNotification($a_not)
isObjectCalendarVisible(string $type)
enableBatchFileDownloads($a_stat)
setEnabled($a_enabled)
set enabled
setCourseCalendarVisible(bool $status)
enableGroupCalendar($a_stat)
setDefaultPeriod(int $default_period)
static lookupCalendarContentPresentationEnabled(int $obj_id)
static _lookupType($a_id, $a_reference=false)
lookup object type
enableSynchronisationCache($a_status)
En/Disable synchronisation cache.
isEnabled()
is calendar enabled
getEnableGroupMilestones()
Get Enable milestone planning feature for groups.
enableCourseCalendar($a_stat)
setDefaultCal(int $default_cal)
isCourseCalendarEnabled()
enableNotification($a_status)
Enable course group notification.
readCalendarSettingsId()
Read ref_id of calendar settings.
__construct()
singleton contructor
useCache($a_status)
Enable cache.
enableCGRegistration($a_status)
Enable optional registration for courses and groups.
isSynchronisationCacheEnabled()
Check if cache is active for calendar synchronisation.
setGroupCalendarVisible(bool $status)
static _lookupContainerSetting($a_id, $a_keyword, $a_default_value=null)
Lookup a container setting.
initStorage()
Init storage class (ilSetting) private.
const DEFAULT_CACHE_MINUTES
setDefaultWeekStart($a_start)
set week start