3 declare(strict_types=1);
93 $this->db = $DIC->database();
101 if (self::$instance) {
102 return self::$instance;
109 if (!self::lookupCalendarActivated($obj_id)) {
114 $default =
$settings->isObjectCalendarVisible($type);
117 'cont_show_calendar',
129 $gl_activated =
false;
145 'cont_activation_calendar',
146 (
string) $gl_activated
152 $this->cache_enabled = $a_status;
162 $this->cache_minutes = $a_min;
172 $this->enabled = $a_enabled;
182 $this->week_start = $a_start;
212 $this->timezone = $a_zone;
222 $this->date_format = $a_format;
232 $this->time_format = $a_format;
247 $this->day_start = $a_start;
257 $this->day_end = $a_end;
267 $this->consultation_hours = $a_status;
282 $this->sync_cache_enabled = $a_status;
287 $this->sync_cache_minutes = $a_min;
312 $this->notification_user = $a_not;
317 $this->cg_registration = $a_status;
327 $this->course_cal_enabled = $a_stat;
342 $this->course_cal_visible = $status;
358 $this->group_cal_enabled = $a_stat;
373 $this->group_cal_visible = $status;
378 $this->webcal_sync = $a_stat;
388 $this->webcal_sync_hours = $a_hours;
398 $this->show_weeks = $a_val;
408 $this->batch_file_downloads = $a_stat;
418 $this->storage->set(
'enabled', (
string) (
int) $this->
isEnabled());
425 $this->storage->set(
'cache_minutes', (
string) $this->
getCacheMinutes());
428 $this->storage->set(
'cache_enabled', (
string) (
int) $this->
isCacheUsed());
439 $this->storage->set(
'show_weeks', (
string) (
int) $this->
getShowWeeks());
441 $this->storage->set(
'default_calendar_view', (
string) $this->
getDefaultCal());
447 $this->
setEnabled((
bool) $this->storage->get(
'enabled'));
449 $this->
setDefaultWeekStart((
int) $this->storage->get(
'default_week_start', (
string) self::WEEK_START_MONDAY));
450 $this->
setDefaultDateFormat((
int) $this->storage->get(
'default_date_format', (
string) self::DATE_FORMAT_DMY));
451 $this->
setDefaultTimeFormat((
int) $this->storage->get(
'default_time_format', (
string) self::TIME_FORMAT_24));
452 $this->
setDefaultDayStart((
int) $this->storage->get(
'default_day_start', (
string) self::DEFAULT_DAY_START));
453 $this->
setDefaultDayEnd((
int) $this->storage->get(
'default_day_end', (
string) self::DEFAULT_DAY_END));
454 $this->
useCache((
bool) $this->storage->get(
'cache_enabled', (
string) $this->cache_enabled));
455 $this->
setCacheMinutes((
int) $this->storage->get(
'cache_minutes', (
string) self::DEFAULT_CACHE_MINUTES));
457 'sync_cache_enabled',
458 (
string) $this->isSynchronisationCacheEnabled()
461 'sync_cache_minutes',
462 (
string) self::DEFAULT_SYNC_CACHE_MINUTES
464 $this->
enableNotification((
bool) $this->storage->get(
'notification', (
string) $this->isNotificationEnabled()));
466 'consultation_hours',
467 (
string) $this->areConsultationHoursEnabled()
471 (
string) $this->isCGRegistrationEnabled()
475 (
string) $this->isCourseCalendarEnabled()
478 'course_cal_visible',
479 (
string) $this->isCourseCalendarVisible()
481 $this->
enableGroupCalendar((
bool) $this->storage->get(
'group_cal', (
string) $this->isGroupCalendarEnabled()));
484 (
string) $this->isGroupCalendarVisible()
488 (
string) $this->isUserNotificationEnabled()
490 $this->
enableWebCalSync((
bool) $this->storage->get(
'webcal_sync', (
string) $this->isWebCalSyncEnabled()));
491 $this->
setWebCalSyncHours((
int) $this->storage->get(
'webcal_sync_hours', (
string) $this->getWebCalSyncHours()));
492 $this->
setShowWeeks((
bool) $this->storage->get(
'show_weeks', (
string) $this->getShowWeeks()));
495 (
string) $this->isBatchFileDownloadsEnabled()
497 $this->
setDefaultCal((
int) $this->storage->get(
'default_calendar_view', (
string) $this->getDefaultCal()));
498 $this->
setDefaultPeriod((
int) $this->storage->get(
'default_period', (
string) $this->getDefaultPeriod()));
503 $query =
"SELECT ref_id FROM object_reference obr " .
504 "JOIN object_data obd ON obd.obj_id = obr.obj_id " .
505 "WHERE type = 'cals'";
507 $set = $this->db->query($query);
508 $row = $this->db->fetchAssoc($set);
510 $this->cal_settings_id = (
int) $row[
"ref_id"];
515 $this->storage =
new ilSetting(
'calendar');
static _getDefaultTimeZone()
Calculate and set default time zone.
setDefaultTimeZone(string $a_zone)
static lookupCalendarActivated(int $a_obj_id)
isBatchFileDownloadsEnabled()
isCourseCalendarVisible()
isUserNotificationEnabled()
setDefaultTimeFormat(int $a_format)
enableCourseCalendar(bool $a_stat)
enableConsultationHours(bool $a_status)
const DEFAULT_SYNC_CACHE_MINUTES
enableBatchFileDownloads(bool $a_stat)
static _lookupContainerSetting(int $a_id, string $a_keyword, string $a_default_value=null)
enableSynchronisationCache(bool $a_status)
setDefaultDayStart(int $a_start)
setCacheMinutes(int $a_min)
setWebCalSyncHours(int $a_hours)
enableGroupCalendar(bool $a_stat)
getSynchronisationCacheMinutes()
enableUserNotification(bool $a_not)
isCGRegistrationEnabled()
const DATE_FORMAT_UNDEFINED
areConsultationHoursEnabled()
enableWebCalSync(bool $a_stat)
bool $batch_file_downloads
isObjectCalendarVisible(string $type)
setCourseCalendarVisible(bool $status)
setDefaultPeriod(int $default_period)
static lookupCalendarContentPresentationEnabled(int $obj_id)
enableCGRegistration(bool $a_status)
setDefaultWeekStart(int $a_start)
setShowWeeks(bool $a_val)
setDefaultDayEnd(int $a_end)
static ilCalendarSettings $instance
enableNotification(bool $a_status)
setDefaultCal(int $default_cal)
setDefaultDateFormat(int $a_format)
isCourseCalendarEnabled()
static _lookupType(int $id, bool $reference=false)
setSynchronisationCacheMinutes(int $a_min)
isSynchronisationCacheEnabled()
setGroupCalendarVisible(bool $status)
const DEFAULT_CACHE_MINUTES
setEnabled(bool $a_enabled)