3declare(strict_types=1);
94 $this->db =
$DIC->database();
102 if (self::$instance) {
110 if (!self::lookupCalendarActivated($obj_id)) {
118 'cont_show_calendar',
130 $gl_activated =
false;
146 'cont_activation_calendar',
147 (
string) $gl_activated
153 $this->cache_enabled = $a_status;
163 $this->cache_minutes = $a_min;
173 $this->enabled = $a_enabled;
183 $this->week_start = $a_start;
213 $this->timezone = $a_zone;
223 $this->date_format = $a_format;
233 $this->time_format = $a_format;
248 $this->day_start = $a_start;
258 $this->day_end = $a_end;
268 $this->consultation_hours = $a_status;
278 $this->enablegroupmilestones = $a_enablegroupmilestones;
293 $this->sync_cache_enabled = $a_status;
298 $this->sync_cache_minutes = $a_min;
323 $this->notification_user = $a_not;
328 $this->cg_registration = $a_status;
338 $this->course_cal_enabled = $a_stat;
353 $this->course_cal_visible = $status;
369 $this->group_cal_enabled = $a_stat;
384 $this->group_cal_visible = $status;
389 $this->webcal_sync = $a_stat;
399 $this->webcal_sync_hours = $a_hours;
409 $this->show_weeks = $a_val;
419 $this->batch_file_downloads = $a_stat;
429 $this->storage->set(
'enabled', (
string) (
int) $this->
isEnabled());
437 $this->storage->set(
'cache_minutes', (
string) $this->
getCacheMinutes());
440 $this->storage->set(
'cache_enabled', (
string) (
int) $this->
isCacheUsed());
451 $this->storage->set(
'show_weeks', (
string) (
int) $this->
getShowWeeks());
453 $this->storage->set(
'default_calendar_view', (
string) $this->
getDefaultCal());
459 $this->
setEnabled((
bool) $this->storage->get(
'enabled'));
461 $this->
setDefaultWeekStart((
int) $this->storage->get(
'default_week_start', (
string) self::WEEK_START_MONDAY));
462 $this->
setDefaultDateFormat((
int) $this->storage->get(
'default_date_format', (
string) self::DATE_FORMAT_DMY));
463 $this->
setDefaultTimeFormat((
int) $this->storage->get(
'default_time_format', (
string) self::TIME_FORMAT_24));
465 $this->
setDefaultDayStart((
int) $this->storage->get(
'default_day_start', (
string) self::DEFAULT_DAY_START));
466 $this->
setDefaultDayEnd((
int) $this->storage->get(
'default_day_end', (
string) self::DEFAULT_DAY_END));
467 $this->
useCache((
bool) $this->storage->get(
'cache_enabled', (
string) $this->cache_enabled));
468 $this->
setCacheMinutes((
int) $this->storage->get(
'cache_minutes', (
string) self::DEFAULT_CACHE_MINUTES));
470 'sync_cache_enabled',
471 (
string) $this->isSynchronisationCacheEnabled()
474 'sync_cache_minutes',
475 (
string) self::DEFAULT_SYNC_CACHE_MINUTES
477 $this->
enableNotification((
bool) $this->storage->get(
'notification', (
string) $this->isNotificationEnabled()));
479 'consultation_hours',
480 (
string) $this->areConsultationHoursEnabled()
484 (
string) $this->isCGRegistrationEnabled()
488 (
string) $this->isCourseCalendarEnabled()
491 'course_cal_visible',
492 (
string) $this->isCourseCalendarVisible()
494 $this->
enableGroupCalendar((
bool) $this->storage->get(
'group_cal', (
string) $this->isGroupCalendarEnabled()));
497 (
string) $this->isGroupCalendarVisible()
501 (
string) $this->isUserNotificationEnabled()
503 $this->
enableWebCalSync((
bool) $this->storage->get(
'webcal_sync', (
string) $this->isWebCalSyncEnabled()));
504 $this->
setWebCalSyncHours((
int) $this->storage->get(
'webcal_sync_hours', (
string) $this->getWebCalSyncHours()));
505 $this->
setShowWeeks((
bool) $this->storage->get(
'show_weeks', (
string) $this->getShowWeeks()));
508 (
string) $this->isBatchFileDownloadsEnabled()
510 $this->
setDefaultCal((
int) $this->storage->get(
'default_calendar_view', (
string) $this->getDefaultCal()));
511 $this->
setDefaultPeriod((
int) $this->storage->get(
'default_period', (
string) $this->getDefaultPeriod()));
516 $query =
"SELECT ref_id FROM object_reference obr " .
517 "JOIN object_data obd ON obd.obj_id = obr.obj_id " .
518 "WHERE type = 'cals'";
520 $set = $this->db->query(
$query);
521 $row = $this->db->fetchAssoc($set);
523 $this->cal_settings_id = (
int) $row[
"ref_id"];
528 $this->storage =
new ilSetting(
'calendar');
Stores all calendar relevant settings.
setDefaultDayEnd(int $a_end)
static lookupCalendarContentPresentationEnabled(int $obj_id)
setEnableGroupMilestones(bool $a_enablegroupmilestones)
setCourseCalendarVisible(bool $status)
isCourseCalendarEnabled()
enableWebCalSync(bool $a_stat)
isObjectCalendarVisible(string $type)
setDefaultDateFormat(int $a_format)
setDefaultDayStart(int $a_start)
setCacheMinutes(int $a_min)
setSynchronisationCacheMinutes(int $a_min)
const DATE_FORMAT_UNDEFINED
enableSynchronisationCache(bool $a_status)
setDefaultWeekStart(int $a_start)
setWebCalSyncHours(int $a_hours)
setDefaultTimeZone(string $a_zone)
isCGRegistrationEnabled()
setDefaultTimeFormat(int $a_format)
areConsultationHoursEnabled()
const DEFAULT_CACHE_MINUTES
isUserNotificationEnabled()
enableNotification(bool $a_status)
setEnabled(bool $a_enabled)
enableBatchFileDownloads(bool $a_stat)
isCourseCalendarVisible()
isBatchFileDownloadsEnabled()
isSynchronisationCacheEnabled()
bool $batch_file_downloads
setShowWeeks(bool $a_val)
enableCourseCalendar(bool $a_stat)
enableUserNotification(bool $a_not)
enableConsultationHours(bool $a_status)
setDefaultPeriod(int $default_period)
static lookupCalendarActivated(int $a_obj_id)
enableCGRegistration(bool $a_status)
setGroupCalendarVisible(bool $status)
setDefaultCal(int $default_cal)
const DEFAULT_SYNC_CACHE_MINUTES
static ilCalendarSettings $instance
enableGroupCalendar(bool $a_stat)
bool $enablegroupmilestones
getSynchronisationCacheMinutes()
getEnableGroupMilestones()
static _lookupContainerSetting(int $a_id, string $a_keyword, string $a_default_value=null)
static _lookupType(int $id, bool $reference=false)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _getDefaultTimeZone()
Calculate and set default time zone.