3 declare(strict_types=1);
94 $this->db = $DIC->database();
102 if (self::$instance) {
103 return 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');
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)
setEnableGroupMilestones(bool $a_enablegroupmilestones)
setDefaultPeriod(int $default_period)
static lookupCalendarContentPresentationEnabled(int $obj_id)
bool $enablegroupmilestones
enableCGRegistration(bool $a_status)
setDefaultWeekStart(int $a_start)
setShowWeeks(bool $a_val)
getEnableGroupMilestones()
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)