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');
138 #$parser = new ilICalParser('./extern/Feiertage.ics',ilICalParser::INPUT_FILE);
139 #$parser->setCategoryId(6);
150 #echo "RESULT: ".$list;
170 #$parser = new ilICalParser('./extern/fc.ics',ilICalParser::INPUT_FILE);
171 #$parser->setCategoryId(11);
172 #$parser = new ilICalParser('./Feiertage.ics',ilICalParser::INPUT_FILE);
174 #$entry = new ilCalendarEntry(927);
190 $this->tabs_gui->setTabActive(
'settings');
192 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.settings.html',
'Services/Calendar');
193 $this->tpl->setVariable(
'CAL_SETTINGS',$this->form->getHTML());
205 $this->
settings->setDefaultWeekStart((
int) $_POST[
'default_week_start']);
207 $this->
settings->setDefaultTimeFormat((
int) $_POST[
'default_time_format']);
208 $this->
settings->setEnableGroupMilestones((
int) $_POST[
'enable_grp_milestones']);
209 $this->
settings->setDefaultDayStart((
int) $_POST[
'dst']);
210 $this->
settings->setDefaultDayEnd((
int) $_POST[
'den']);
211 $this->
settings->enableSynchronisationCache((
bool) $_POST[
'sync_cache']);
212 $this->
settings->setSynchronisationCacheMinutes((
int) $_POST[
'sync_cache_time']);
213 $this->
settings->setCacheMinutes((
int) $_POST[
'cache_time']);
214 $this->
settings->useCache((
bool) $_POST[
'cache']);
216 if(((
int) $_POST[
'den']) < (
int) $_POST[
'dst'])
236 include_once(
'Services/Calendar/classes/class.ilCalendarSettings.php');
247 if(is_object($this->form))
251 include_once(
'Services/Calendar/classes/class.ilCalendarUtil.php');
252 include_once(
'Services/Form/classes/class.ilPropertyFormGUI.php');
255 $this->form->setFormAction($this->ctrl->getFormAction($this));
256 $this->form->setTitle($this->lng->txt(
'cal_global_settings'));
257 $this->form->addCommandButton(
'save',$this->lng->txt(
'save'));
258 #$this->form->addCommandButton('cancel',$this->lng->txt('cancel'));
262 $check->setChecked($this->
settings->isEnabled() ?
true :
false);
263 $this->form->addItem($check);
267 $this->form->addItem($server_tz);
269 $select =
new ilSelectInputGUI($this->lng->txt(
'cal_def_timezone'),
'default_timezone');
271 $select->setInfo($this->lng->txt(
'cal_def_timezone_info'));
272 $select->setValue($this->
settings->getDefaultTimeZone());
273 $this->form->addItem($select);
275 $select =
new ilSelectInputGUI($this->lng->txt(
'cal_def_time_format'),
'default_time_format');
279 $select->setInfo($this->lng->txt(
'cal_def_time_format_info'));
280 $select->setValue($this->
settings->getDefaultTimeFormat());
281 $this->form->addItem($select);
288 $radio->addOption($option);
290 $radio->addOption($option);
295 $cache->setInfo($this->lng->txt(
'cal_cache_info'));
296 $cache->setRequired(
true);
298 $sync_cache =
new ilRadioOption($this->lng->txt(
'cal_cache_disabled'),0);
299 $cache->addOption($sync_cache);
301 $sync_cache =
new ilRadioOption($this->lng->txt(
'cal_cache_enabled'),1);
302 $cache->addOption($sync_cache);
305 $cache_t->setValue($this->
settings->getCacheMinutes());
306 $cache_t->setMinValue(0);
307 $cache_t->setSize(3);
308 $cache_t->setMaxLength(3);
309 $cache_t->setSuffix($this->lng->txt(
'form_minutes'));
310 $sync_cache->addSubItem($cache_t);
311 $this->form->addItem(
$cache);
314 $checkm =
new ilCheckboxInputGUI($this->lng->txt(
'cal_enable_group_milestones'),
'enable_grp_milestones');
316 $checkm->setChecked($this->
settings->getEnableGroupMilestones() ?
true :
false);
317 $checkm->setInfo($this->lng->txt(
'cal_enable_group_milestones_desc'));
318 $this->form->addItem($checkm);
320 $this->form->addItem($radio);
327 $day_start->setValue($this->
settings->getDefaultDayStart());
328 $this->form->addItem($day_start);
334 $day_end->setValue($this->
settings->getDefaultDayEnd());
335 $this->form->addItem($day_end);
339 $sec->setTitle($this->lng->txt(
'cal_sync_header'));
340 $this->form->addItem($sec);
343 $cache->setValue((
int) $this->
settings->isSynchronisationCacheEnabled());
344 $cache->setInfo($this->lng->txt(
'cal_sync_cache_info'));
345 $cache->setRequired(
true);
347 $sync_cache =
new ilRadioOption($this->lng->txt(
'cal_sync_disabled'),0);
348 $cache->addOption($sync_cache);
350 $sync_cache =
new ilRadioOption($this->lng->txt(
'cal_sync_enabled'),1);
351 $cache->addOption($sync_cache);
354 $cache_t->setValue($this->
settings->getSynchronisationCacheMinutes());
355 $cache_t->setMinValue(0);
356 $cache_t->setSize(3);
357 $cache_t->setMaxLength(3);
358 $cache_t->setSuffix($this->lng->txt(
'form_minutes'));
359 $sync_cache->addSubItem($cache_t);
361 $this->form->addItem(
$cache);