34 include_once(
'./classes/class.ilObjectGUI.php');
44 public function __construct($a_data, $a_id, $a_call_by_reference =
true, $a_prepare_output =
true)
52 $this->lng->loadLanguageModule(
'dateplaner');
53 $this->lng->loadLanguageModule(
'jscalendar');
66 $next_class = $this->ctrl->getNextClass($this);
67 $cmd = $this->ctrl->getCmd();
71 if(!$ilAccess->checkAccess(
'read',
'',$this->object->getRefId()))
73 $ilErr->raiseError($this->lng->txt(
'no_permission'),$ilErr->WARNING);
78 case 'ilpermissiongui':
79 $this->tabs_gui->setTabActive(
'perm_settings');
80 include_once(
"Services/AccessControl/classes/class.ilPermissionGUI.php");
82 $ret =& $this->ctrl->forwardCommand($perm_gui);
86 $this->tabs_gui->setTabActive(
'settings');
108 global $rbacsystem, $ilAccess;
110 if ($ilAccess->checkAccess(
"read",
'',$this->object->getRefId()))
112 $this->tabs_gui->addTarget(
"settings",
113 $this->ctrl->getLinkTarget($this,
"settings"),
114 array(
"settings",
"view"));
117 if ($ilAccess->checkAccess(
'edit_permission',
'',$this->object->getRefId()))
119 $this->tabs_gui->addTarget(
"perm_settings",
120 $this->ctrl->getLinkTargetByClass(
'ilpermissiongui',
"perm"),
121 array(),
'ilpermissiongui');
130 include_once(
'./Services/Calendar/classes/class.ilDateTime.php');
132 include_once(
'./Services/Calendar/classes/iCal/class.ilICalParser.php');
134 include_once(
'./Services/Calendar/classes/class.ilCalendarRecurrenceCalculator.php');
135 include_once(
'./Services/Calendar/classes/class.ilCalendarRecurrence.php');
136 include_once(
'./Services/Calendar/classes/class.ilCalendarEntry.php');
139 #$parser = new ilICalParser('./extern/Feiertage.ics',ilICalParser::INPUT_FILE);
140 #$parser->setCategoryId(6);
151 #echo "RESULT: ".$list;
171 #$parser = new ilICalParser('./extern/fc.ics',ilICalParser::INPUT_FILE);
172 #$parser->setCategoryId(11);
173 #$parser = new ilICalParser('./Feiertage.ics',ilICalParser::INPUT_FILE);
175 #$entry = new ilCalendarEntry(927);
191 $this->tabs_gui->setTabActive(
'settings');
193 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.settings.html',
'Services/Calendar');
194 $this->tpl->setVariable(
'CAL_SETTINGS',$this->form->getHTML());
206 $this->
settings->setDefaultWeekStart((
int) $_POST[
'default_week_start']);
208 $this->
settings->setDefaultDateFormat((
int) $_POST[
'default_date_format']);
209 $this->
settings->setDefaultTimeFormat((
int) $_POST[
'default_time_format']);
210 $this->
settings->setEnableGroupMilestones((
int) $_POST[
'enable_grp_milestones']);
211 $this->
settings->setDefaultDayStart((
int) $_POST[
'dst']);
212 $this->
settings->setDefaultDayEnd((
int) $_POST[
'den']);
213 $this->
settings->enableSynchronisationCache((
bool) $_POST[
'sync_cache']);
214 $this->
settings->setSynchronisationCacheMinutes((
int) $_POST[
'sync_cache_time']);
215 $this->
settings->setCacheMinutes((
int) $_POST[
'cache_time']);
216 $this->
settings->useCache((
bool) $_POST[
'cache']);
217 $this->
settings->enableNotification((
bool) $_POST[
'cn']);
218 $this->
settings->enableConsultationHours((
bool) $_POST[
'ch']);
219 $this->
settings->enableCGRegistration((
bool) $_POST[
'cgr']);
221 if(((
int) $_POST[
'den']) < (
int) $_POST[
'dst'])
241 include_once(
'Services/Calendar/classes/class.ilCalendarSettings.php');
252 if(is_object($this->form))
256 include_once(
'Services/Calendar/classes/class.ilCalendarUtil.php');
257 include_once(
'Services/Form/classes/class.ilPropertyFormGUI.php');
260 $this->form->setFormAction($this->ctrl->getFormAction($this));
261 $this->form->setTitle($this->lng->txt(
'cal_global_settings'));
262 $this->form->addCommandButton(
'save',$this->lng->txt(
'save'));
263 #$this->form->addCommandButton('cancel',$this->lng->txt('cancel'));
267 $check->setChecked($this->
settings->isEnabled() ?
true :
false);
268 $this->form->addItem($check);
272 $this->form->addItem($server_tz);
274 $select =
new ilSelectInputGUI($this->lng->txt(
'cal_def_timezone'),
'default_timezone');
276 $select->setInfo($this->lng->txt(
'cal_def_timezone_info'));
277 $select->setValue($this->
settings->getDefaultTimeZone());
278 $this->form->addItem($select);
281 $select =
new ilSelectInputGUI($this->lng->txt(
'cal_def_date_format'),
'default_date_format');
286 $select->setInfo($this->lng->txt(
'cal_def_date_format_info'));
287 $select->setValue($this->
settings->getDefaultDateFormat());
288 $this->form->addItem($select);
290 $select =
new ilSelectInputGUI($this->lng->txt(
'cal_def_time_format'),
'default_time_format');
294 $select->setInfo($this->lng->txt(
'cal_def_time_format_info'));
295 $select->setValue($this->
settings->getDefaultTimeFormat());
296 $this->form->addItem($select);
303 $radio->addOption($option);
305 $radio->addOption($option);
307 $this->form->addItem($radio);
314 $day_start->setValue($this->
settings->getDefaultDayStart());
315 $this->form->addItem($day_start);
321 $day_end->setValue($this->
settings->getDefaultDayEnd());
322 $this->form->addItem($day_end);
328 $mil->setTitle($this->lng->txt(
'cal_milestone_settings'));
329 $this->form->addItem($mil);
331 $checkm =
new ilCheckboxInputGUI($this->lng->txt(
'cal_enable_group_milestones'),
'enable_grp_milestones');
333 $checkm->setChecked($this->
settings->getEnableGroupMilestones() ?
true :
false);
334 $checkm->setInfo($this->lng->txt(
'cal_enable_group_milestones_desc'));
335 $this->form->addItem($checkm);
339 $con->setTitle($this->lng->txt(
'cal_ch_form_header'));
340 $this->form->addItem($con);
343 $ch->
setInfo($this->lng->txt(
'cal_ch_form_info'));
345 $ch->setChecked($this->
settings->areConsultationHoursEnabled());
346 $this->form->addItem($ch);
351 $not->setTitle($this->lng->txt(
'notifications'));
352 $this->form->addItem($not);
356 $cgn->setChecked($this->
settings->isNotificationEnabled());
357 $cgn->setInfo($this->lng->txt(
'cal_adm_notification_info'));
358 $this->form->addItem($cgn);
362 $book->setTitle($this->lng->txt(
'cal_registrations'));
363 $this->form->addItem($book);
367 $cgn->setChecked($this->
settings->isCGRegistrationEnabled());
368 $cgn->setInfo($this->lng->txt(
'cal_cg_registration_info'));
369 $this->form->addItem($cgn);
373 $sec->setTitle($this->lng->txt(
'cal_cache_settings'));
374 $this->form->addItem($sec);
378 $cache->setInfo($this->lng->txt(
'cal_sync_cache_info'));
379 $cache->setRequired(
true);
381 $sync_cache =
new ilRadioOption($this->lng->txt(
'cal_sync_disabled'),0);
382 $cache->addOption($sync_cache);
384 $sync_cache =
new ilRadioOption($this->lng->txt(
'cal_sync_enabled'),1);
385 $cache->addOption($sync_cache);
388 $cache_t->setValue($this->
settings->getSynchronisationCacheMinutes());
389 $cache_t->setMinValue(0);
390 $cache_t->setSize(3);
391 $cache_t->setMaxLength(3);
392 $cache_t->setSuffix($this->lng->txt(
'form_minutes'));
393 $sync_cache->addSubItem($cache_t);
395 $this->form->addItem($cache);
400 $cache->setInfo($this->lng->txt(
'cal_cache_info'));
401 $cache->setRequired(
true);
403 $sync_cache =
new ilRadioOption($this->lng->txt(
'cal_cache_disabled'),0);
404 $cache->addOption($sync_cache);
406 $sync_cache =
new ilRadioOption($this->lng->txt(
'cal_cache_enabled'),1);
407 $cache->addOption($sync_cache);
410 $cache_t->setValue($this->
settings->getCacheMinutes());
411 $cache_t->setMinValue(0);
412 $cache_t->setSize(3);
413 $cache_t->setMaxLength(3);
414 $cache_t->setSuffix($this->lng->txt(
'form_minutes'));
415 $sync_cache->addSubItem($cache_t);
416 $this->form->addItem($cache);